This is a simplified sketch for an Arduino midi controller, I want to add indicator lights to the buttons so that they turn on/off with the note on/off commands I tried adding pinMode(13, OUTPUT); to the setup, and then digitalWrite(13, HIGH); and digitalWrite(13, LOW); to the loop but the lights still don't work any suggestions?
#include <Bounce.h>
const int channel = 1;
Bounce button0 = Bounce(0, 5);
void setup() {
pinMode(0, INPUT_PULLUP);
}
void loop() {
button0.update();
if (button0.fallingEdge()) {
usbMIDI.sendNoteOn(60, 99, channel); // 60 = C4
}
if (button0.risingEdge()) {
usbMIDI.sendNoteOff(60, 0, channel); // 60 = C4
}
while (usbMIDI.read()) {
}
}
#include <Bounce.h>
const int channel = 1;
Bounce button0 = Bounce(0, 5);
void setup() {
pinMode(0, INPUT_PULLUP);
}
void loop() {
button0.update();
if (button0.fallingEdge()) {
usbMIDI.sendNoteOn(60, 99, channel); // 60 = C4
}
if (button0.risingEdge()) {
usbMIDI.sendNoteOff(60, 0, channel); // 60 = C4
}
while (usbMIDI.read()) {
}
}