Heya,
I am using USB-MIDI (for MAX MSP routing), I can send one button at the time by using this code
/* send midi note on/off when button is pressed on Pin 2 */
#include "MIDIUSB.h"
void setup()
{
pinMode(2, INPUT_PULLUP);
}
void loop()
{
if( digitalRead(2) == false )
{
// note on
midiEventPacket_t noteOn = {0x09, 0x90, 60, 100};
MidiUSB.sendMIDI(noteOn);
MidiUSB.flush();
delay(500);
// note off
midiEventPacket_t noteOff = {0x09, 0x90, 0, 0};
MidiUSB.sendMIDI(noteOff);
MidiUSB.flush();
delay(500);
}
}
(same with one analog in) but I cant figure out how to send multiple ones and how to define them