Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8013

MicroPython • Re: Pico and Midi - Baud Rate Query

$
0
0
Maybe it's an issue with unicode. I would try this -

Code:

from machine import Pin, UARTimport timeuart = UART(0, baudrate=31250, bits=8, parity=None, stop=1, tx=Pin(16), rx=Pin(17), invert=UART.INV_TX)while True:  for channel in range(0, 16):    for programNumber in range(0, 3):      msg = bytearray()      msg.append(0xC0 + channel)      msg.append(programNumber)      print("Send", msg)      uart.write(msg)      time.sleep(0.5)
Thought : I have never used UART - Do you have to flush after the write ?

I would also try without invert, and also post the circuit diagram for your output - If the wiring is wrong it isn't ever going to work.

Statistics: Posted by hippy — Sun Sep 14, 2025 11:31 pm



Viewing all articles
Browse latest Browse all 8013

Trending Articles