Skip to content

Instantly share code, notes, and snippets.

@miccolis
Created October 10, 2012 02:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save miccolis/1e9ef74f04f28e217878 to your computer and use it in GitHub Desktop.
Save miccolis/1e9ef74f04f28e217878 to your computer and use it in GitHub Desktop.
#include "MIDI.h"
void HandleNoteOn(byte channel, byte pitch, byte velocity) {
if (velocity == 0) { digitalWrite(13, LOW); }
else { digitalWrite(13, HIGH); }
}
void setup() {
pinMode(13, OUTPUT);
digitalWrite(13, HIGH);
delay(10);
digitalWrite(13, LOW);
MIDI.begin();
MIDI.setHandleNoteOn(HandleNoteOn);
}
void loop() {
MIDI.read();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment