ghi-electronics / micropython

A MicroPython port to GHI Electronics SITCore SC13xxx line of products.
https://micropython.org
MIT License
0 stars 0 forks source link

UART #11

Open Palomino34 opened 3 years ago

Palomino34 commented 3 years ago

How to use UART0, UART1....

Palomino34 commented 3 years ago

from machine import UART

uart2 = UART(2, 9600) # open uart2 with given baudrate - PA2( P2) = TX, PA3 (P1) = RX) uart2.init(9600, bits=8, parity=None, stop=1) # init with given parameters uart2.read(10) # read 10 characters, returns a bytes object uart2.read() # read all available characters uart2.write('abc') # write the 3 characters