File tree 3 files changed +9
-9
lines changed
3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 4
4
Send data from the UART1 port to the UART0 port.
5
5
6
6
== Other code to try
7
- ``` python
8
- uart0 = UART(0) #opens a UART connection at the default baudrate of 115,200
9
- uart0.readline() #reads until the CR (\r) and NL (\n) characters then returns the line
10
- ```
7
+ [source. python]
8
+ uart0 = UART(0) #opens a UART connection at the default baudrate of 115,200
9
+ uart0.readline() #reads until the CR (\r) and NL (\n) characters then returns the line
10
+
11
11
12
12
== Wiring information
13
13
14
14
See <<uart-wiring-diagram>> for wiring instructions.
15
15
16
16
[[uart-wiring-diagram]]
17
17
[pdfwidth=75%]
18
- .Wiring two of the Pico's ports together
18
+ .Wiring two of the Pico's ports together. Be sure to wire UART0:TX to UART1:RX and UART0:RX to UART1:TX.
19
19
image::pico_uart_example.png[]
20
20
21
21
== List of Files
22
22
23
23
A list of files with descriptions of their function;
24
24
25
- uart.py:: The example code.
25
+ uart.py:: The example code.
Original file line number Diff line number Diff line change 7
7
8
8
txData = b'hello world\n \r '
9
9
uart1 .write (txData )
10
- time .sleep (1 )
10
+ time .sleep (0. 1 )
11
11
rxData = bytes ()
12
12
while uart0 .any () > 0 :
13
- rxData += uart0 .read ()
14
-
13
+ rxData += uart0 .read (1 )
14
+
15
15
print (rxData .decode ('utf-8' ))
You can’t perform that action at this time.
0 commit comments