请问能否提供一份openmv的UART硬件流控制的dome代码?
-
使用usb-ttl与ESP32UART硬件流控制正常,接usb-ttl换为OPENMV时出现问题,去掉CTS RTS tcp上位机可接收到jpge,jpge有数据丢失,未达到UART硬件流控制效果。参考中文文档未解决,能否提供一份一份openmv的UART硬件流控制的dome代码?谢谢。
PS:使用IDE2.9.0,固件为4.3.0,UART3(P4 P5) CTS P2 RTS P1。import sensor, image, time import time from machine import UART import utime sensor.reset() # Reset and initialize the sensor. sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE) sensor.set_framesize(sensor.VGA) # Set frame size to QVGA (320x240) sensor.skip_frames(time = 2000) # Wait for settings take effect. uart = UART(3, 5000000,flow=UART.CTS,timtout=1000,timeout_char=1000,read_buf_len=5120) # 使用给定参数初始化 #uart = UART(3, 5000000,timeout_char=1000) #uart.init(5000000,flow=UART.CTS,timeout_char=1000,read_buf_len=5120) # 使用给定参数初始化 #flow=UART.RTS|UART.CTS while(True): frame = sensor.snapshot() cframe = frame.compress(quality=15)#compressed uart.write(bytes(cframe))
-
uart.write(bytes(cframe))改为uart.write(cframe)
-
@xwm6 等我重新买一个usb-ttl测试