• 免费好用的星瞳AI云服务上线!简单标注,云端训练,支持OpenMV H7和OpenMV H7 Plus。可以替代edge impulse。 https://forum.singtown.com/topic/9519
  • 我们只解决官方正版的OpenMV的问题(STM32),其他的分支有很多兼容问题,我们无法解决。
  • 如果有产品硬件故障问题,比如无法开机,论坛很难解决。可以直接找售后维修
  • 发帖子之前,请确认看过所有的视频教程,https://singtown.com/learn/ 和所有的上手教程http://book.openmv.cc/
  • 每一个新的提问,单独发一个新帖子
  • 帖子需要目的,你要做什么?
  • 如果涉及代码,需要报错提示全部代码文本,请注意不要贴代码图片
  • 必看:玩转星瞳论坛了解一下图片上传,代码格式等问题。
  • lcd连接数据线的时候能正常显示,外接电源之后中间有一半白屏是怎么回事



    • lcd连接数据线的时候能正常显示,外接电源之后中间有一半白屏是怎么回事



    • 需要提供代码,和照片。



    • THRESHOLD = (51, 100, 0, 21, 12, 33) #线路阈值
      import sensor, image, time,lcd
      from pyb import Servo
      from pid import PID
      rho_pid = PID(p=0.4, i=0) #截距
      theta_pid = PID(p=0.001, i=0) #斜率

      s1 = Servo(3) # P9
      def run(_angle,_range,_sleep): #角度,幅度,间隔延时
      s1.angle(_angle+_range) #角度,转到该角度的时间
      time.sleep(_sleep)
      s1.angle(_angle-_range)
      time.sleep(_sleep)

      sensor.reset()
      sensor.set_pixformat(sensor.RGB565)
      sensor.set_framesize(sensor.QQVGA) # 80x60 (4,800 pixels) - O(N^2) max = 2,3040,000.
      #sensor.set_windowing([0,20,80,40])
      sensor.skip_frames(time = 2000) # WARNING: If you use QQVGA it may take seconds
      clock = time.clock() # to process a frame sometimes.

      lcd.init()

      while(True):
      clock.tick()
      #img = sensor.snapshot()
      img = sensor.snapshot()
      line = img.get_regression([(100,100,0,0,0,0)], robust = True)
      if (line):
      rho_err = abs(line.rho())-img.width()/2
      if line.theta()>90:
      theta_err = line.theta()-180
      else:
      theta_err = line.theta()
      img.draw_line(line.line(), color = 127)
      print(rho_err,line.magnitude(),theta_err)

          #lcd.display(sensor.snapshot())
          lcd.display(img.draw_line(line.line(),color=127))
          if line.magnitude()>0:
              #if -40<b_err<40 and -30<t_err<30:
              rho_output = rho_pid.get_pid(rho_err,1)
              theta_output = theta_pid.get_pid(theta_err,1)
              output = rho_output+theta_output
              #output=output*3
              if theta_err>70:        #限制摆动角度
                  theta_err=70
              if theta_err<-70:
                  theta_err=-70
              run(theta_err,15,180)     #角度,幅度,间隔延时
          pass![0_1572269044774_852B78E315A605550E330DB196766244.jpg](https://fcdn.singtown.com/0c8ae143-f07e-48e3-99e2-85338bb96b25.jpg)


    • 0_1572269094064_852B78E315A605550E330DB196766244.jpg



    • https://singtown.com/learn/49601/

      用例子进行测试。