I'm trying to sketch up the code for controlling two LPD8806, 60-LED strips but I keep getting an error I don't understand.
Here's the code I'm trying:
#include "LPD8806.h"
#include "SPI.h"
int nLEDs1 = 60;
int nLEDs2 = 60;
int s1dataPin = 2;
int s2dataPin = 4;
int s1clockPin = 3;
int s2clockPin = 5;
LPD8806 strip1 = LPD8806(nLEDs1, s1dataPin, s1clockPin);
LPD8806 strip2 = LPD8806(nLEDs2, s2dataPin. s2clockPin);
void setup() {
strip1.begin();
strip2.begin();
strip1.show();
strip2.show();
}
void loop() {
colorChase1(strip1.Color(127, 0, 0), 100);
colorChase2(strip2.Color(127, 0, 0), 100);
colorChase1(strip1.Color( 0,127, 0), 100);
colorChase2(strip2.Color( 0,127, 0), 100);
colorChase1(strip1.Color( 0, 0,127), 100);
colorChase2(strip2.Color( 0, 0,127), 100);
colorChase1(strip1.Color(127,127,127), 100);
colorChase2(strip2.Color(127,127,127), 100);
}
void colorChase1(uint32_t c, uint8_t wait) {
int i;
for(i=0; i<strip1.numPixels(); i++) strip1.setPixelColor(i, 0);
for(i=0; i<strip1.numPixels(); i++) {
strip1.setPixelColor(i, c);
strip1.show();
strip1.setPixelColor(i, 0);
delay(wait);
}
strip1.show();
}
void colorChase2(uint32_t c, uint8_t wait) {
int i;
for(i=0; i<strip2.numPixels(); i++) strip2.setPixelColor(i, 0);
for(i=0; i<strip2.numPixels(); i++) {
strip2.setPixelColor(i, c);
strip2.show();
strip2.setPixelColor(i, 0);
delay(wait);
}
strip2.show();
}
The error I'm getting is:
13: error: request for member 's2clockPin' in 's2dataPin', which is of non-class type 'int'
And this error stays the same if I use s2clockPin and s2dataPin for strip1.
Am I on the right track with this code?
If not, how do I run two strips in parallel without hooking them up in series and without using a second board?