12 lines
308 B
Python
12 lines
308 B
Python
|
import serial
|
||
|
try:
|
||
|
ser = serial.Serial('COM4', 9600,timeout=None)
|
||
|
except:
|
||
|
print("Serial port not found")
|
||
|
exit()
|
||
|
|
||
|
ser.write("p0.pic=0".encode("gb2312"))
|
||
|
ser.write(b'\xFF\xFF\xFF')
|
||
|
|
||
|
ser.write("g0.txt=\"喜迎二十大,永远跟党走,奋进新征程.\"".encode("gb2312"))
|
||
|
ser.write(b'\xFF\xFF\xFF')
|