File tree Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Expand file tree Collapse file tree 3 files changed +9
-9
lines changed Original file line number Diff line number Diff line change 44Send data from the UART1 port to the UART0 port.
55
66== 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+
1111
1212== Wiring information
1313
1414See <<uart-wiring-diagram>> for wiring instructions.
1515
1616[[uart-wiring-diagram]]
1717[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.
1919image::pico_uart_example.png[]
2020
2121== List of Files
2222
2323A list of files with descriptions of their function;
2424
25- uart.py:: The example code.
25+ uart.py:: The example code.
Original file line number Diff line number Diff line change 77
88txData = b'hello world\n \r '
99uart1 .write (txData )
10- time .sleep (1 )
10+ time .sleep (0. 1 )
1111rxData = bytes ()
1212while uart0 .any () > 0 :
13- rxData += uart0 .read ()
14-
13+ rxData += uart0 .read (1 )
14+
1515print (rxData .decode ('utf-8' ))
You can’t perform that action at this time.
0 commit comments