Code: Select all
# Test UART for Midi Input
# https://docs.micropython.org/en/latest/library/machine.UART.html
import utime
from machine import UART, Pin
rxPin=Pin(1,Pin.IN,Pin.PULL_UP)
txPin=Pin(0,Pin.OUT)
#uart=UART(0,31250, rx=rxPin, tx=txPin, invert=UART.INV_TX) # does not work #init with given baudrate
uart=UART(0,31250, rx=rxPin, tx=txPin) # does work #init with given baudrate
while True:
uart.write("hello") #write "hello"
utime.sleep(1)
Many thanks in advance, Christof