@yuan 7号引脚用于输出高低电平,用USB接口或是Vin、gnd供电,每次用hello world的示例就会复原,但运行我的程序长了就会泛红,现在泛红越来越频繁了
叶晓一 发布的帖子
-
RE: 为什么图像会泛红色
-
RE: 为什么图像会泛红色
@kidswong999
运行hello world是正常的,我的代码如下thresholds = [ (30, 100, 15, 127, 15, 127), # generic_red_thresholds (30, 100, -64, -8, -32, 32), # generic_green_thresholds (0, 30, 0, 64, -128, 0)] # generic_blue_thresholds sensor.reset() sensor.set_pixformat(sensor.RGB565) sensor.set_framesize(sensor.QVGA) sensor.skip_frames(time = 2000) sensor.set_auto_gain(False) # must be turned off for color tracking sensor.set_auto_whitebal(False) # must be turned off for color tracking clock = time.clock() uart = UART(3, 115200) # Only blobs that with more pixels than "pixel_threshold" and more area than "area_threshold" are # returned by "find_blobs" below. Change "pixels_threshold" and "area_threshold" if you change the # camera resolution. "merge=True" merges all overlapping blobs in the image. while(True): clock.tick() img = sensor.snapshot() blobs = img.find_blobs([thresholds[threshold_index]], pixels_threshold=6000, area_threshold=7000, merge=True) if blobs: for blob in blobs: img.draw_rectangle(blob.rect()) img.draw_cross(blob.cx(), blob.cy()) #print(clock.fps()) if blob.cx()>=150: output_str="%d" % (blob.cx()) print('you send:',output_str) uart.write(output_str+'\r\n') pyb.delay(300) uart = UART(3, 115200, timeout_char=1000) pyb.delay(4000) pyb.delay(300) else: #output_str="0" #print('you send:',output_str) #uart.write(output_str+'\r\n') pyb.delay(300)