# Untitled - By: 16652 - 周五 1月 4 2019
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)
uart=UART(3,9600);
clock = time.clock()
while(True):
clock.tick()
img = sensor.snapshot()
img = sensor.snapshot().lens_corr(1.8)
circles = img.find_circles(threshold = 2000, x_margin = 10, y_margin = 10, r_margin = 10,
r_min = 2, r_max = 100, r_step = 2)
if circles:
data=[]
for c in circles:
img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0))
data.append((c.x(),c.y()))
data_out = json.dumps(set(data))
uart.write(data_out +'\n')
请提具体的问题,
比如目的,具体的报错提示。