Cleaning up examples.

This commit is contained in:
Francois Best 2012-09-06 11:16:53 +02:00
parent ea96fbd211
commit ad9ba0da58
2 changed files with 6 additions and 3 deletions

View File

@ -6,8 +6,8 @@
// see documentation here:
// http://arduinomidilib.sourceforge.net/class_m_i_d_i___class.html
void HandleNoteOn(byte channel, byte pitch, byte velocity) {
void HandleNoteOn(byte channel, byte pitch, byte velocity)
{
// Do whatever you want when you receive a Note On.
if (velocity == 0) {
@ -33,4 +33,7 @@ void loop() {
MIDI.read();
// There is no need to check if there are messages incoming if they are bound to a Callback function.
// The attached method will be called automatically when the corresponding message has been received.
}

View File

@ -30,7 +30,7 @@ void setup() {
void loop() {
if (MIDI.read()) { // Is there a MIDI message incoming ?
switch(MIDI.getType()) { // Get the type of the message we caught
case ProgramChange: // If it is a Program Change
case midi::ProgramChange: // If it is a Program Change
BlinkLed(MIDI.getData1()); // Blink the LED a number of times
// correponding to the program number
// (0 to 127, it can last a while..)