add python script

This commit is contained in:
Maxime
2024-03-14 14:27:02 +01:00
parent 0038c5be56
commit 924f457d0a

11
serial_listener.py Normal file
View File

@@ -0,0 +1,11 @@
# from https://stackoverflow.com/questions/26047544/python-serial-port-listener
import serial
import select
timeout = 10
conn = serial.Serial("/dev/ttyUSB0", 115200, timeout=0)
read,_,_ = select.select([conn], [], [], timeout)
while True:
read_data = conn.read(0x100)
if read_data:
print(read_data)