Update code, diagram, and README

Fixed things several errors.
pull/22/head
7west 2021-02-24 21:56:51 -05:00 zatwierdzone przez GitHub
rodzic 335ef9381e
commit 8b1bf5f30c
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
3 zmienionych plików z 9 dodań i 9 usunięć

Wyświetl plik

@ -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.

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 148 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 148 KiB

Wyświetl plik

@ -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'))