Skip to content

Commit 8b1bf5f

Browse files
authored
Update code, diagram, and README
Fixed things several errors.
1 parent 335ef93 commit 8b1bf5f

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

uart/README.adoc

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@
44
Send 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

1414
See <<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.
1919
image::pico_uart_example.png[]
2020

2121
== List of Files
2222

2323
A list of files with descriptions of their function;
2424

25-
uart.py:: The example code.
25+
uart.py:: The example code.

uart/pico_uart_example.png

146 Bytes
Loading

uart/uart.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
txData = b'hello world\n\r'
99
uart1.write(txData)
10-
time.sleep(1)
10+
time.sleep(0.1)
1111
rxData = bytes()
1212
while uart0.any() > 0:
13-
rxData += uart0.read()
14-
13+
rxData += uart0.read(1)
14+
1515
print(rxData.decode('utf-8'))

0 commit comments

Comments
 (0)