synth/arm/test.py

19 lines
301 B
Python
Raw Normal View History

2022-06-19 07:41:17 +00:00
import serial
s = serial.Serial('tty', 115200, timeout=6)
length = 1
log = open('test.log', 'wb')
while True:
print(f'Writing {length} bytes')
s.write(b'b' * length);
data = s.read(length)
log.write(data)
if not data:
break
length += 1
print(f'Read back 0 bytes')