各位大神们,我在扫描二维码时遇到了问题,我想把二维码扫描到的内容(内容是123)通过串口发送出去,请问具体发送的语句该怎么改呢,我现在用的是下面的程序,但每次扫到二维码时都报错,求大神帮助!!!!!
import time
from pyb import UART
import sensor, image
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QQVGA) # can be QVGA on M7...
sensor.skip_frames(30)
sensor.set_auto_gain(False) # must turn this off to prevent image washout...
uart = UART(3, 19200)
while(True):
img = sensor.snapshot()
img.lens_corr(1.8) # strength of 1.8 is good for the 2.8mm lens.
for code in img.find_qrcodes():
print(code)
write(code.payload)