导航

    • 登录
    • 搜索
    • 版块
    • 产品
    • 教程
    • 论坛
    • 淘宝
    1. 主页
    2. u2gf
    U
    • 举报资料
    • 资料
    • 关注
    • 粉丝
    • 屏蔽
    • 帖子
    • 楼层
    • 最佳
    • 群组

    u2gf

    @u2gf

    0
    声望
    6
    楼层
    230
    资料浏览
    0
    粉丝
    0
    关注
    注册时间 最后登录

    u2gf 关注

    u2gf 发布的帖子

    • RE: 无论是高电平 还是低电平 蜂鸣器一直闷响

      没有报错,就是蜂鸣器一直闷响😿

      发布在 OpenMV Cam
      U
      u2gf
    • RE: 无论是高电平 还是低电平 蜂鸣器一直闷响
      import sensor, image, time, math, lcd
      from pyb import UART    #串口
      from pyb import Pin
      import json
      import machine
      threshold_index = 3 # threshold_index的数值对应了列表thresholds[]中的色块LAB
      thresholds = [(19, 100, -68, -6, -35, -5), #深蓝色
                    (17, 100, -50, -1, -27, -2),#浅蓝色
                    (92, 62, -6, 38, 38, -13),  #粉色
                    (30, 66, -2, -32, -29, -11)]  #白色
      buzzer = Pin('P0', Pin.OUT_PP)
      buzzer.low()
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QQVGA2)
      sensor.skip_frames(time = 2000)
      sensor.set_auto_gain(False)      # 关闭白平衡
      sensor.set_auto_whitebal(False)  # 关闭自动增益
      clock = time.clock()
      lcd.init()                       #初始化LCD
      uart = UART(3, 115200)           #初始化串口
      uart.init(115200, bits=8, parity=None, stop=1)  #8位数据位,无校验位,1位停止位、
      while(True):
          clock.tick()
          img = sensor.snapshot()
          blob = img.find_blobs([thresholds[threshold_index]], area_threshold=300)
          text = 2;
          if blob: #如果找到了目标颜色
              text = 1
              if text == 1:
                  print("MASK YES")
                  uart.write("MASK YES")
                  buzzer.low()
              for b in blob:
                  #迭代找到的目标颜色区域
                  img.draw_rectangle(b[0:4]) # rect
                  img.draw_cross(b[5], b[6]) # cx, cy
                  img.draw_string(35, 70, "MASK!!")
          if text == 2:#如果没有找到口罩
              print("ON MASK")
              uart.write("ON MASK")
              img.draw_string(35, 70, "NO MASK!!")
              buzzer.high()  # 蜂鸣器响
              #time.sleep(200)  # 延时200毫秒
              #buzzer.low()  # 停止蜂鸣器
          lcd.display(img)
      
      发布在 OpenMV Cam
      U
      u2gf
    • 无论是高电平 还是低电平 蜂鸣器一直闷响

      蜂鸣器VCC连接openmv的VIN引脚和3.3V引脚效果一样,只是3.3V声音大一点,也是一直闷响 下面是代码0_1685411590380_屏幕截图 1.jpg 0_1685411597704_屏幕截图 2.jpg

      发布在 OpenMV Cam
      U
      u2gf
    • can't import

      0_1685353445298_屏幕截图 2023-05-29 174311.jpg
      想在检测到颜色块后增添一个蜂鸣器响,为什么can't import name pin呢

      发布在 OpenMV Cam
      U
      u2gf
    • openmv可以电路仿真吗

      openMV不是相当于一个单片机吗 有没有相关软件可以进行电路仿真呢 害怕烧坏硬件

      发布在 OpenMV Cam
      U
      u2gf
    • LCD不能正常显示图像?

      openMV与LCD连接上后,在openMV IDE上运行示例 lcd.py程序,可是LCD上显示的图像是一条一条的,LCD板子不是星瞳科技的,是TFT-LCD ST7735S型号的,想问一下是什么原因呀😟

      发布在 OpenMV Cam
      U
      u2gf