I'm getting the error 'Color' was not declared in this scope on the code below with c = Color(255,0,0); being highlighted. I'm trying to get the LPD8806 LED strips to run a color pattern from the center and I'm missing something that's preventing the code to compile.
Thanks,
Phil
#include "LPD8806.h"
#include "SPI.h"
int dataPin = 2;
int clockPin = 3;
const int numPixels = 32;
LPD8806 strip = LPD8806(32, dataPin, clockPin);
void loop() {
int i;
uint32_t c;
// Set all pixels to red
c = Color(255,0,0);
for (i=0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, c);
}
strip.show();
delay(100);
// Wipe from middle:
c = Color(255, 255, 255); // white
for (i=strip.numPixels() / 2 - 1; i >= 0; i--) { // half of strip, count down to 0
strip.setPixelColor(i, c); // left pixel
strip.setPixelColor(strip.numPixels() - 1 - i, c); // right pixel
strip.show();
delay(100);
}
}
phil007:
I'm getting the error 'Color' was not declared in this scope on the code below with c = Color(255,0,0); being highlighted. I'm trying to get the LPD8806 LED strips to run a color pattern from the center and I'm missing something that's preventing the code to compile.
Looks like Color is a member function of the object created. Just as you did with all the other member functions, you need to tell the compiler which object to call that function for.