logo

为什么会出现reset failed和capture failed 啊

2022-03-02 20:21
A
xlcq
import sensor, image, time, pyb
from pyb import Pin
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()
    
    img = sensor.snapshot()

    
    img = sensor.snapshot().lens_corr(1.8)
    
    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)

    for r in img.find_rects(threshold = 10000):
        img.draw_rectangle(r.rect(), color = (255, 0, 0))

        print(r)

    print("FPS %f" % clock.fps())
    print("FPS %f" % clock.fps())
    circles=img.find_circles(threshold = 3500, x_margin = 10, y_margin = 10, r_margin = 10,r_min = 2, r_max = 100, r_step = 2)
    rects=img.find_rects(threshold = 10000)
    if circles:
       led1.on()
       time.sleep(3000)
       led1.off()
       time.sleep(100)
       led1.on()
       time.sleep(3000)
       led1.off()
       time.sleep(100)

    if rects:
        p_out=Pin('A8',Pin.OUT_PP)
        p_out.high()
931883ab-4535-42da-8084-73de5cfa5242.png
c661d21b-d834-4bc6-a789-3e4413627cd2.png
2022-03-03 18:32
I
网红小智智 星瞳科技

最后的Pin A8是做什么的?应该只用P0~P9