Hello, I'm trying to modify Firmata to use the Adafruit Neopixel library. Presently nothing works, any pixel does't light up any color.
What am I doing wrong?
#include <Adafruit_NeoPixel.h>
#include <Firmata.h>
#define PIN 6
// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS 16
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
//void sysexCallbackFunction(byte pin, byte byteCount, byte *arrayPointer);
void sysexCallback(byte num, byte argc, byte *argv)
{
pixels.begin();
pixels.setPixelColor(num, pixels.Color(argc, argv[0], argv[1]));
}
void setup() {
// put your setup code here, to run once:
Firmata.setFirmwareVersion(FIRMATA_MAJOR_VERSION, FIRMATA_MINOR_VERSION);
Firmata.attach(START_SYSEX, sysexCallback);
Firmata.begin();
}
void loop() {
// put your main code here, to run repeatedly:
while (Firmata.available()) {
Firmata.processInput();
}
}