import sensor, image, time ,tv
from pyb import UART
from pyb import Pin, Timer
sensor.reset()
sensor.set_pixformat(sensor.GRAYSCALE)
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()
uart = UART(3, 19200)
tv.init() # 初始化tv
# 50kHz pin6 timer2 channel1
#light = Timer(2, freq=18000).channel(1, Timer.PWM, pin=Pin("P6"))
#light.pulse_width_percent(100) # adjust light 0~100
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.payload())
if code.payload() is not None :
uart.write(code.payload() + "\r")
tv.display(img)
if uart.any() :
a = uart.readline().decode()
print(a)
# print(clock.fps())openmv4p + mt9v034模块 使用v3.9.2固件版本,其他硬件使用 ttl转rs232模块 连接串口转wifi硬件模块出现串口无法使用的问题,即无法发送与接收。刷上固件版本v3.6.8 串口发送和接收可正常使用,是什么原因?


这个是两个单独的问题。串口的问题,单独发一个帖子,单独使用串口功能测试。
https://github.com/openmv/openmv/releases/tag/v3.9.3
3.9.3修复了TV扩展版的灰度问题。
@kidswong999 好的 谢谢您
@kidswong999 已解决 谢谢您