import sensor, image, time,pyb,math
from pyb import UART
sensor.reset()
sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.QVGA)
sensor.skip_frames(time = 2000)
uart = UART(3,9600,timeout=1000)
clock = time.clock()
while(True):
clock.tick()
img = sensor.snapshot()
if uart.any():
print('OK')
d=uart.readchar()
print(d)
if(d=='A'):
pyb.LED(2).on()arduino代码
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.write('A');
delay(5000);
Serial.write('B');
delay(5000);
}在电脑上arduino串口可以看到发送数据,但是openmv接收不到没有信息发过来
你的线是怎么连接的。
arduino的10 11 软串口接的p4 p5 然后gnd相连 那两个通信线对调了还是没反应
Arduino的Serial 是0和1,你用10和11错了。
参考:
https://book.openmv.cc/MCU/serial1.html