识别到圆形之后,小灯1闪烁,应该怎么做?
-
import sensor, image, time, pyb
sensor.reset()
sensor.set_pixformat(sensor.RGB565) # 灰度更快
sensor.set_framesize(sensor.QQVGA)
sensor.skip_frames(time = 2000)
clock = time.clock()
led1 = pyb.LED(1)while(True):
clock.tick()for c in img.find_circles(threshold = 3500, x_margin = 10, y_margin = 10, r_margin = 10,r_min = 2, r_max = 100, r_step = 2): img.draw_circle(c.x(), c.y(), c.r(), color = (255, 0, 0)) print(c) print("FPS %f" % clock.fps()) led1.on() time.sleep(3000) led1.off() time.sleep(100) led1.on() time.sleep(3000) led1.off() time.sleep(100)
-
time.sleep(3000)是3000秒,改为time.sleep_ms(3000)
-
圆们 = img.find_circles() if 圆们: print("找到了") else: print("没找到")