We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a225b32 commit 1683e4cCopy full SHA for 1683e4c
1 file changed
02.inputs/ts.py
@@ -0,0 +1,16 @@
1
+import time
2
+from machine import UART
3
+
4
+uart = UART(2) # UART(2) RX16 TX17
5
+uart.init(57600, bits=8, parity=None, stop=1)
6
7
+uart.write('hello world')
8
+while True:
9
+ recvlen = uart.any()
10
+ if time.time() % 5 == 0:
11
+ if recvlen > 0:
12
+ time.sleep_ms(1000)
13
+ print('------')
14
+ buffer = uart.read(recvlen)
15
+ uart.write(buffer)
16
+ print(buffer)
0 commit comments