向串口发送列表
-
import sensor, image, time
from pyb import UART
sensor.reset() # Reset and initialize the sensor.
sensor.set_pixformat(sensor.RGB565) # Set pixel format to RGB565 (or GRAYSCALE)
sensor.set_framesize(sensor.QVGA) # Set frame size to QVGA (320x240)
sensor.skip_frames(time = 2000) # Wait for settings take effect.
clock = time.clock()
uart=UART(3,9600)# Create a clock object to track the FPS.
uart.init(9600,bits=8,parity=None,stop=1)
list=[1,1,2]
while(True):clock.tick() uart.write(list)
我现在这样写他会出现 需要具有缓冲协议的对象,该怎么改。
-
先把列表转换成字符串