导航

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

    w3tb

    @w3tb

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

    w3tb 关注

    w3tb 发布的帖子

    • openmv串口通信发送坐标给单片机,通过字符串的形式发送十进制数据,为什么发不过去
      import sensor
      import time
      import image
      import display
      from machine import UART # 调用串口通信
      
      sensor.reset()  # 初始化sensor函数
      sensor.set_pixformat(sensor.RGB565)  # 设置RGB565
      sensor.set_framesize(sensor.QQVGA)  # QQVGA分辨率160X120
      #sensor.set_hmirror(Ture) # 水平方向翻转
      #sensor.set_vfilp(Ture) # 垂直方向翻转
      sensor.set_auto_gain(False) # 自动增益
      sensor.set_auto_whitebal(False) # 自动白平衡
      sensor.skip_frames(10)  # 跳过10张照片,等待感光元件变稳定
      lcd = display.SPIDisplay() # 调用lcd屏幕
      
      Range = (0,0,160,120) # 设置感兴趣区域
      uart = UART(3, 115200) # 使用串口3,波特率为115200
      
      pink_threshold = (83, 23, 19, 124, -73, 70) # 粉色阈值
      
      while(True):
          img = sensor.snapshot()  # 从感光芯片获得一张图像并返回给img
          #img = sensor.snapshot().lens_corr(strength = 1.8,zoom = 1.0) # 从感光芯片获得一张图像,校准畸变处理,并返回给img
          lcd.write(sensor.snapshot()) # 拍照的数据写入lcd中并显示出来
          for blob in img.find_blobs([pink_threshold],roi = Range, pixels_threshold = 100, area_threshold = 100, merge = True, margin = 10):
              img.draw_rectangle(blob.rect()) # 画框
              img.draw_cross(blob.cx(),blob.cy()) # 画十字
              print(blob.cx(),blob.cy()) # 打印坐标
              #list = [blob.cx(),blob.cy()] # 放到列表中
              #data = bytearray([0xFF,list[0],list[1],0xFE]) # 发送数据包(帧头,数据,数据,帧尾)
              output_str = "0xFF,blob.cx(),bloc.cy(),0xFE"
              #data = bytearray(0xFF,"list[0],list[1]",0xFE)
              #uart.write(data)# 串口发送数据
              uart.write(output_str)# 串口发送字符串
      
      发布在 OpenMV Cam
      W
      w3tb
    • openmv和stm32串口通信为什么发送的是十六进制数据,而不是十进制数据?
      import sensor
      import time
      import image
      import display
      from machine import UART # 调用串口通信
      
      sensor.reset()  # 初始化sensor函数
      sensor.set_pixformat(sensor.RGB565)  # 设置RGB565
      sensor.set_framesize(sensor.QQVGA)  # QQVGA分辨率160X120
      #sensor.set_hmirror(Ture) # 水平方向翻转
      #sensor.set_vfilp(Ture) # 垂直方向翻转
      sensor.set_auto_gain(False) # 自动增益
      sensor.set_auto_whitebal(False) # 自动白平衡
      sensor.skip_frames(10)  # 跳过10张照片,等待感光元件变稳定
      lcd = display.SPIDisplay() # 调用lcd屏幕
      
      Range = (0,0,160,120) # 设置感兴趣区域
      uart = UART(3, 115200) # 使用串口3,波特率为115200
      
      pink_threshold = (83, 23, 19, 124, -73, 70) # 粉色阈值
      
      while(True):
          img = sensor.snapshot()  # 从感光芯片获得一张图像并返回给img
          #img = sensor.snapshot().lens_corr(strength = 1.8,zoom = 1.0) # 从感光芯片获得一张图像,校准畸变处理,并返回给img
          lcd.write(sensor.snapshot()) # 拍照的数据写入lcd中并显示出来
          for blob in img.find_blobs([pink_threshold],roi = Range, pixels_threshold = 100, area_threshold = 100, merge = True, margin = 10):
              img.draw_rectangle(blob.rect()) # 画框
              img.draw_cross(blob.cx(),blob.cy()) # 画十字
              print(blob.cx(),blob.cy()) # 打印坐标
              list = [blob.cx(),blob.cy()] # 放到列表中
              data = bytearray([0xFF,list[0],list[1],0xFE]) # 发送数据包(帧头,数据,数据,帧尾)
              uart.write(data)# 串口发送请在这里粘贴代码
      
      发布在 OpenMV Cam
      W
      w3tb
    • 为什么openmv在与单片机串口通信时发送的数据是十六进制的数据?

      openmv在与单片机串口通信时发送的数据是十六进制的数据

      发布在 OpenMV Cam
      W
      w3tb