However it seems like I am not picking up all the bytes I am expecting to.
I have defined the UART on the RX1 input of the RP2040 by:-
Code: Select all
uart = busio.UART(None, board.GP5, bits=8, parity=None, stop=1, timeout=0.03, baudrate=31250) # MIDI Baud rate
Code: Select all
def updateMIDIin():
data = uart.read(3) # read up to 32 bytes
if data is not None:
print("got data ")
print(data)
followed by 0x80, 0x34, 0x60 - Note off
But what I am receiving is:-
got data
b'\x904`'
got data
b'\x804`'
I have played about with the time out but still not getting all the bytes I expect. Reading six rather than three bytes just repeats the same sort of thing only on the same line.
I did try the code:-
Code: Select all
data_string = ''.join([chr(0) for b in data])
print(data_string, end="")
Has anyone any idea where I am going wrong?
Thanks