Update code, diagram, and README

Fixed things several errors.
This commit is contained in:
7west 2021-02-24 21:56:51 -05:00 committed by GitHub
parent 335ef9381e
commit 8b1bf5f30c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View File

@ -4,10 +4,10 @@
Send data from the UART1 port to the UART0 port.
== Other code to try
```python
uart0 = UART(0) #opens a UART connection at the default baudrate of 115,200
uart0.readline() #reads until the CR (\r) and NL (\n) characters then returns the line
```
[source.python]
uart0 = UART(0) #opens a UART connection at the default baudrate of 115,200
uart0.readline() #reads until the CR (\r) and NL (\n) characters then returns the line
== Wiring information
@ -15,11 +15,11 @@ See <<uart-wiring-diagram>> for wiring instructions.
[[uart-wiring-diagram]]
[pdfwidth=75%]
.Wiring two of the Pico's ports together
.Wiring two of the Pico's ports together. Be sure to wire UART0:TX to UART1:RX and UART0:RX to UART1:TX.
image::pico_uart_example.png[]
== List of Files
A list of files with descriptions of their function;
uart.py:: The example code.
uart.py:: The example code.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 148 KiB

View File

@ -7,9 +7,9 @@ uart0 = UART(0, baudrate=9600, tx=Pin(0), rx=Pin(1))
txData = b'hello world\n\r'
uart1.write(txData)
time.sleep(1)
time.sleep(0.1)
rxData = bytes()
while uart0.any() > 0:
rxData += uart0.read()
rxData += uart0.read(1)
print(rxData.decode('utf-8'))