2021-02-25 19:50:57 -05:00
|
|
|
import busio
|
|
|
|
import board
|
|
|
|
import time
|
|
|
|
|
|
|
|
i = 0
|
|
|
|
|
|
|
|
u = busio.UART(tx=board.TX, rx=board.RX)
|
|
|
|
|
|
|
|
while True:
|
|
|
|
u.write(str(i).encode("utf-8"))
|
|
|
|
time.sleep(0.1)
|
2021-03-15 09:57:36 -04:00
|
|
|
print(i, u.in_waiting) # should be the number of digits
|
2021-02-25 19:50:57 -05:00
|
|
|
time.sleep(0.1)
|
2021-03-15 09:57:36 -04:00
|
|
|
print(i, u.in_waiting) # should be the number of digits
|
2021-02-25 19:50:57 -05:00
|
|
|
r = u.read(64 + 10)
|
2021-03-15 09:57:36 -04:00
|
|
|
print(i, u.in_waiting) # should be 0
|
2021-02-25 19:50:57 -05:00
|
|
|
print(len(r), r)
|
|
|
|
i += 1
|