cs-midi-docs/docs/examples/03-interfaces/04-serial-midi.md

497 B

Serial MIDI

Classic 5-pin DIN MIDI over hardware UART at 31250 baud.

Constructor: HardwareSerialMIDI_Interface(uart_inst_t *uart, uint tx_pin, uint rx_pin)

#include "pico/stdlib.h"
#include <cs_midi.h>

using namespace cs;

HardwareSerialMIDI_Interface midi {uart0, 12, 13};

CCRotaryEncoder enc {{0, 2}, {16, Channel_1}, 1, 4};

int main() {
    stdio_init_all();
    Control_Surface.begin();
    while (true) {
        Control_Surface.loop();
        sleep_ms(1);
    }
}