diff options
Diffstat (limited to 'tests/circuitpython-manual/busio/uart_echo.py')
| -rw-r--r-- | tests/circuitpython-manual/busio/uart_echo.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/circuitpython-manual/busio/uart_echo.py b/tests/circuitpython-manual/busio/uart_echo.py new file mode 100644 index 000000000..f55d4db9e --- /dev/null +++ b/tests/circuitpython-manual/busio/uart_echo.py @@ -0,0 +1,18 @@ +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) + print(i, u.in_waiting) # should be the number of digits + time.sleep(0.1) + print(i, u.in_waiting) # should be the number of digits + r = u.read(64 + 10) + print(i, u.in_waiting) # should be 0 + print(len(r), r) + i += 1 |
