logo

为什么串口输入123后他没有反应,不拍照。

2022-09-26 11:15
L
weig
# Blob Detection and uart transport
import sensor, image, time,socket
from pyb import UART
import json

uart = UART(1, 115200,timeout_char=1000)

while(True):
    if uart.any():
        a=uart.read().decode()
        print(a)
        if(a==12):
            img = sensor.snapshot()
        elif(a==123):
            print(0)
2022-09-26 20:16
I
网红小智智 星瞳科技

你这个a是个字符串

https://singtown.com/learn/50240/