软件在线运行openMV的时候出现runtimeerror:capture Failed:-4
-
import sensor, image, time sensor.reset() sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QQVGA) sensor.skip_frames(time = 200) clock = time.clock() sensor.set_auto_gain(False) import pyb red_led = pyb.LED(1) green_led = pyb.LED(2) blue_led = pyb.LED(3) ir_leds = pyb.LED(4) f_x = (2.8 / 3.984) * 160 f_y = (2.8 / 2.952) * 120 c_x = 160 * 0.5 c_y = 120 * 0.5 from pyb import UART uart = UART(1, 57600, timeout_char=10) uart.init(57600, bits=8, parity=None, stop=1) tmp_data=1 temp=1 while(True): clock.tick() img = sensor.snapshot() img.lens_corr(1.8) for code in img.find_qrcodes(): uart.write("0") uart.write(code.payload()) uart.write("3") img.draw_rectangle(code.x(),code.y(),code.w(),code.h(), color = (255, 0, 0)) img.draw_cross(code.x(), code.y(), color = (0, 255, 0)) print(code) if uart.any(): tmp_data = uart.readchar() print(tmp_data)
这个程序用来扫码,之前一直可以扫,今天突然脱机运行的时候闪两下红灯。电脑也连不上去。
-
重新烧录固件,用hello world测试,如果还不行就联系售后维修。