romu-usb-midi-controller.ino

Romu USB Development Board (RP2354A) · File : romu-usb-midi-controller.ino · Language : C++ (Arduino) · Use case : Transformer la Romu en contrôleur MIDI USB minimaliste utilisant le bouton intégré.

Arduino code to send MIDI notes via USB when the Romu's button is pressed.

Install the Raspberry Pi Pico core in the Arduino IDE. Add the 'Arduino MIDI Library'. Identify the button GPIO on the Romu (usually a single button). Compile and upload. Plug the Romu into a PC; it will appear as a USB MIDI device usable in a DAW.

romu-usb-midi-controller.ino

// Exemple Arduino pour Romu (RP2354A) - Contrôleur MIDI USB
// Nécessite la bibliothèque Arduino MIDI Library

#include <MIDI.h>

// Définir le bouton intégré (à adapter selon le schéma Romu, ex: GPIO 23)
const int BUTTON_PIN = 23; 

MIDI_CREATE_DEFAULT_INSTANCE();

void setup() {
  pinMode(BUTTON_PIN, INPUT_PULLUP);
  MIDI.begin(MIDI_CHANNEL_OMNI);
  
  // Envoyer un message de démarrage
  MIDI.sendNoteOn(60, 127, 1); // Note C4, vélocité max, canal 1
  delay(100);
  MIDI.sendNoteOff(60, 0, 1);
}

void loop() {
  // Lire l'état du bouton
  bool buttonState = digitalRead(BUTTON_PIN);
  
  // Si le bouton est pressé (LOW car INPUT_PULLUP)
  if (buttonState == LOW) {
    // Envoyer une note MIDI (ex: C4)
    MIDI.sendNoteOn(60, 127, 1);
    delay(200); // Anti-rebond simple
    MIDI.sendNoteOff(60, 0, 1);
  }
  
  delay(50);
}

← Back to the board