This repository has been archived on 2024-01-06. You can view files and clone it, but cannot push or open issues or pull requests.
justhomework/Quartus/UART_screen/s.py

12 lines
308 B
Python
Raw Normal View History

2022-06-14 06:22:54 +00:00
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')