• 大小: 1KB
    文件类型: .py
    金币: 2
    下载: 1 次
    发布日期: 2021-06-09
  • 语言: Python
  • 标签: 开发  

资源简介

openmv定点代码

资源截图

代码片段和文件信息

import sensor image time
import pyb

def led_T(idflag):
    led = pyb.LED(id)
    if flag:
        led.on()
    else:
        led.off()
    return ~flag

sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
sensor.set_framesize(sensor.QQVGA)
sensor.skip_frames(time = 1000)
clock = time.clock()
uart = pyb.UART(3115200)
last_p = [00]
flag = False
while(True):
    clock.tick()
    img = sensor.snapshot()
    blobs = img.find_blobs([(0 150)])
    max_bl = 0
    max_aera = 0
    for bl in blobs:
        if (bl.w() / bl.h()) < 1.2 and (bl.w() / bl.h()) > 0.8 a

评论

共有 条评论