请在这里粘贴代码import sensor, image, time,pyb
from pyb import UART
import json
green_threshold = ( 7, 100)
uart = UART(3,115200,timeout_char = 1000000)
ROI=(73,36,168,166)
sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.QVGA)
sensor.set_windowing(ROI)
sensor.skip_frames(10)
sensor.set_auto_gain(True)
sensor.set_auto_whitebal(False)
led = pyb.LED(3)
while(True):
clock.tick()
img = sensor.snapshot()
blobs = img.find_blobs([green_threshold],x_stride=2,y_stride=2,area_threshold=6)
led.on()
if blobs:
for b in blobs:
img.draw_cross(b[5],b[6])
print(b[5],b[6])
output_str=bytearray([0xff,0xee,int(b[5]),int(b[6])])
uart.write(output_str)
print(clock.fps())
程序用IDE里测试时没有问题
H
HlikeL
@HlikeL
0
声望
2
楼层
357
资料浏览
0
粉丝
0
关注
HlikeL 发布的帖子
-
串口通信是openmv·里的程序·不会自启动
-
固件缺少某函数库
使用的是openmv3,也使用IDE更新了固件,但是还是一直报错:AttributeError: 'module' object has no attribute 'binary',代码是直接复制例程的