Create uart_test_esp32.py

pull/42/head
Rafael Vidal Aroca 2022-02-18 20:55:15 -03:00 zatwierdzone przez GitHub
rodzic f6c2b76a3b
commit db45629b27
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 13 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,13 @@
from machine import UART
uart = UART(2, tx=17, rx=16)
uart.init(38400, bits=8, parity=None, stop=1)
while True:
data = uart.read(1)
if data is not None:
# Show the byte as 2 hex digits then in the default way
#print("%02x " % (data[0]), end='')
# Or, show the string as received
print("%c" % (data[0]), end='')