如何将openmv识别到的二维码信息发送给arduino主机板?
-
import sensor, image, time from pyb import UART sensor.reset() sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # 必须关闭此功能,以防止图像冲洗… clock = time.clock() uart = UART(3, 9600) #uart.init(9600,8,None,1) #uart.init(9600,8,None,1) while(True): #clock.tick() img = sensor.snapshot() img.lens_corr(1.8) # 1.8的强度参数对于2.8mm镜头来说是不错的。 for code in img.find_qrcodes(): #if(code.payload()=='12'): #at=12 img.draw_rectangle(code.rect(), color = (255, 0, 0)) print(code) print(clock.fps()) output_str="%s" % code.payload() uart.write("Hello World!\r") time.sleep_ms(1000)
-
uart.write(code.payload())