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



    • UART Control

      This example shows how to use the serial port on your OpenMV Cam. Attach pin

      P4 to the serial input of a serial LCD screen to see "Hello World!" printed

      on the serial LCD display.

      import time
      from pyb import UART

      Always pass UART 3 for the UART number for your OpenMV Cam.

      The second argument is the UART baud rate. For a more advanced UART control

      example see the BLE-Shield driver.

      uart = UART(3, 19200, timeout_char=1000)

      while(True):
      if uart.any():
      a = uart.readline()
      if a == "OK\r\n"
      sensor.snapshot().save("example1.jpg")
      我是要用32串口发送个字符串“OK\r\n”,在python中判断接收到的字符串,然后拍照储存到SD卡。



    • 你的if那一行,没有冒号吧



    • 缩进也不对吧……



    • @5ewopython中应该如何判断接收到的字符串是发送的字符串? 中说:

      额,我缩进了4个空格,可能粘贴上去就没了,冒号是没加。但是还是不行,我记得例程中说还要复位一下,是不是必须这样。



    • 代码格式问题
      来自星瞳实验室APP: 必看[视频]:玩转星瞳论坛 https://forum.singtown.com/topic/57

      请贴完整的代码,以及报错提示。



    • # UART Control
      #
      # This example shows how to use the serial port on your OpenMV Cam. Attach pin
      # P4 to the serial input of a serial LCD screen to see "Hello World!" printed
      # on the serial LCD display.
      
      import time
      from pyb import UART
      
      # Always pass UART 3 for the UART number for your OpenMV Cam.
      # The second argument is the UART baud rate. For a more advanced UART control
      # example see the BLE-Shield driver.
      uart = UART(3, 19200, timeout_char=1000)
      
      while(True):
          if uart.any():
              a = uart.readline().decode()
              print(a)
              if a == "OK\r\n":
                  sensor.snapshot().save("example1.jpg")
      

      0_1543926562881_错误.PNG

      Traceback (most recent call last):
      File "", line 17, in
      UnicodeError:
      MicroPython v1.9.4-4510-g23e8457de on 2018-06-29; OPENMV3 with STM32F765
      Type "help()" for more information.



    • 你最后一句的缩进是错的。



    • # UART Control
      #
      # This example shows how to use the serial port on your OpenMV Cam. Attach pin
      # P4 to the serial input of a serial LCD screen to see "Hello World!" printed
      # on the serial LCD display.
      
      import sensor,image
      from pyb import UART
      
      # Always pass UART 3 for the UART number for your OpenMV Cam.
      # The second argument is the UART baud rate. For a more advanced UART control
      # example see the BLE-Shield driver.
      uart = UART(3, 9600, timeout_char=1000)
      
      while(True):
          if uart.any():
              a = uart.readline().decode()
              print(a)
              if a == "OK\r\n":
                  print("You're on camera!")
                  img = sensor.snapshot()
                  img.morph(1, [+2, +1, +0,\
                                +1, +1, -1,\
                                +0, -1, -2])
                  img.save("example.jpg")
                  print("Done! Reset the camera to see the saved image.")
      

      我不知道怎么缩进,我是对照例程改的。

      Traceback (most recent call last):
      File "", line 21, in
      RuntimeError: Sensor Timeout!!
      MicroPython v1.9.4-4510-g23e8457de on 2018-06-29; OPENMV3 with STM32F765
      Type "help()" for more information.

      现在又不行了。



    • 新的问题,单独新发帖子。



    • 行,我先看看,不懂再发,感谢你!