This is the code I am using:-
Code: Select all
"""
MicroPython code to write from UART1 on the Pico
sends some MIDI messages
"""
from machine import UART
from machine import Pin
ser = UART(1, 31250, tx=Pin(8), rx=None) # no recieve
# send control message - works OK
ser.write(chr(0xB0))
ser.write(chr(0x00)) # write bank select msb
ser.write(chr(0x00)) # set to a zero
# send a program change message - produces nothing
ser.write(chr(0xC0))
ser.write(chr(27))
# ask for retune - produces nothing
ser.write(chr(0xF8))
Other messages like note on and note off work this way.