import sensor, image, time,struct,pyb
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
clock = time.clock()
led=pyb.LED(1)
led.on()
time.sleep(500)
led.off()
time.sleep(500)
led.on()
uart = pyb.UART(3, 115200)
uart.init(115200, bits=8, parity=None, stop=1)
def send_data_packet(x, y):
temp = struct.pack("<bbii",
0xAA,
0xAE,
int(x),
int(y))
uart.write(temp)
while(True):
clock.tick()
img = sensor.snapshot()
print(clock.fps())
send_data_packet(0x12,0x13)
uart.write('hello world'+'\r\n')
print('hello world'+'\r\n')为什么我这样想试试串口,串口助手收不到数据
我只用了一根数据线连接openmv跟电脑
https://singtown.com/learn/50235/
看教程操作,需要TTL转串口模块,或者OpenMV串口调试扩展板。