Hello,
Using <midi.h> library V3.2, I just try basically to have a diode blinking when a specific Sysex comes in.
Indeed, my MIDI device sends at each beat the same SysexMessage, where byte[5]==0x10. So I 'd like to have the tempo blinking.
So I wrote the following program :
#include <LiquidCrystal.h>
#include <MIDI.h>
const byte * MyArray;
int ledPin = 13;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup()
{
pinMode(ledPin, OUTPUT);
lcd.begin(16,2);
MIDI.begin();
MIDI.turnThruOff();
}
void loop()
{
MIDI.read();
MyArray = MIDI.getSysExArray();
lcd.setCursor(0,0);
lcd.print(MyArray[5]);
if ((MyArray[5])==0x10 )
{
digitalWrite(ledPin, HIGH);
}
else if ((MyArray[5])!=0x10 )
{
digitalWrite(ledPin, LOW);
}
}
As a result, the diode remains HIGH. It never comes down to the LOW state. When monitoring on the lcd MyArray[5] byte, it remains 0x10 all the time.
So I was wondering what's returned by "MIDI.GetSysExArray" request between 2 SysEx message received?
Does the function keeps in memory the last Sysex message?
If yes, is there a way to flush it?
Lionel