diff options
| author | Jeff Epler <jepler@gmail.com> | 2021-03-01 15:18:32 -0600 |
|---|---|---|
| committer | Jeff Epler <jepler@gmail.com> | 2021-03-01 15:18:32 -0600 |
| commit | 238484ec261af55b90a39a8dcfc9fcdd6cb4390c (patch) | |
| tree | 27811c903f8976b707ee325693521a877ca5661e /tests/circuitpython-manual | |
| parent | 407a8c222a03166a03b8209f752e2a016e977d08 (diff) | |
| parent | 532e7db293a041fb695ce2455ffdb6ac3a3bbf2d (diff) | |
Merge remote-tracking branch 'origin/main' into update-protomatter-rp2
Diffstat (limited to 'tests/circuitpython-manual')
| -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 |
