导航

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

    d46u

    @d46u

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

    d46u 关注

    d46u 发布的帖子

    • 识别二维码并控制舵机运动,识别后的内容作为舵机起动条件,请问中间代码怎么写?

      想实现的结果:摄像头识别到二维码后(二维码扫描得到的内容为1),openmv控制舵机运动抓取物体。

      from pyb import Servo
      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QVGA)
      sensor.skip_frames(time = 2000)
      sensor.set_auto_gain(False) # must turn this off to prevent image washout...
      clock = time.clock()
      
      s1 = Servo(1) # servo on position 1 (P7)   控制舵机1
      s2 = Servo(2) 
      s3 = Servo(3) 
      
      while(True):
          clock.tick()
          img = sensor.snapshot()
          img.lens_corr(1.8) # strength of 1.8 is good for the 2.8mm lens.
          for code in img.find_qrcodes():
              img.draw_rectangle(code.rect(), color = (255, 0, 0))
              print(code)
        
      while(data_type()==1):
      #舵机转动角度
      
      
      
      

      如上,控制舵机的程序,不知道while()里条件怎么填。希望识别到二维码的内容1后舵机能做相应运动。

      发布在 OpenMV Cam
      D
      d46u