from machine import Pin, UART
import time

# UART
uart = UART(1, tx=20, rx=21, baudrate=9600)

print(uart)

uart.write('HELLO UART')

# Čakaj na vhod
while True:
    if uart.any():
        data = uart.read()
        print(data)
        time.sleep(1)