I want to send qrcode information to Arduno using uart. When I read the qr code with OpenMv I got data like this:
{"x":18, "y":17, "w":221, "h":221, "payload":"http://beautifulpixels.blogspot.com/", "version":4, "ecc_level":3, "mask":7, "data_type":4, "eci":0}
And I want to send to arduino this line or just payload whatever.
I am trying with below code, but uart cant send list value how can i send to arduino to this data ?
import pyb
import sensor, image, time
# openMV standart settings:
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
sensor.set_auto_gain(False) # must turn this off to prevent image washout...
clock = time.clock()
#uart initilazing P4:TX and P5:RX
uart = pyb.UART(3, 115200, timeout_char = 1000)
#tracking qr code and send to uart
while(True):
clock.tick()
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():
img.draw_rectangle(code.rect(), color = (255, 0, 0))
print(code.payload())
uart.write("%s",code ) ****HOW CAN I SEND********
print(clock.fps())