I've been using a standard MIDI->Hairless->FastLED (WS2812) script for years on both my Due and Uno which both work fantastically.
Once I switched to the Mega, I found that the same code doesn't work. Triggering the Mega with a standard LED script works fine, but once you introduce the MIDI library, everything falls apart.
Has anyone dealt with this issue? Looking online I noticed ppl saying that they have problems with MIDI library on the Mega, but it does not seem conclusive. Should I just give up on the Mega and just get another Due?
// Create the MIDI Instance
#include <MIDI.h>
// #include <MIDI.hpp>
struct CustomBaud : public midi::DefaultSettings {
static const long BaudRate = BAUDRATE;
};
MIDI_CREATE_CUSTOM_INSTANCE(HardwareSerial, Serial, MIDI, CustomBaud);
void setup() {
FastLED.addLeds<WS2812B, Pin, GRB>(leds, NumLEDs);
FastLED.setBrightness(maxBright);
FastLED.show();
MIDI.setHandleNoteOn(handleNoteOn);
MIDI.setHandleNoteOff(handleNoteOff);
MIDI.setHandleControlChange(handleControlChange);
MIDI.begin(MIDI_CHANNEL_OMNI);
}
void loop() {
MIDI.read(); // Check for MIDI messages every loop
}