Code: Select all
#include "LPD8806.h"
#include "SPI.h"
LPD8806 strip = LPD8806(160);
void setup() {
// Pink
#define COLOR1_R 127
#define COLOR1_G 1
#define COLOR1_B 25
// Aqua
#define COLOR2_R 0
#define COLOR2_G 93
#define COLOR2_B 66
#define top = 100; // maximum value of counter
// Start up the LED strip
strip.begin();
// Update the strip, to start they are all 'off'
strip.show();
}
void loop() {
int r,g,b;
uint16_t i, j;
for (j=0; j < 40; j++) {
r = map(j, 0, 40, COLOR1_R, COLOR2_R);
g = map(j, 0, 40, COLOR1_G, COLOR2_G);
b = map(j, 0, 40, COLOR1_B, COLOR2_B);
for (i=0; i < 160; i++) {
strip.setPixelColor(i,(strip.Color(r,g,b) ));
}
strip.show(); // write all the pixels out
delay(300);
}
for (j=0; j < 40; j++) {
r = map(j, 0, 40, COLOR2_R, COLOR1_R);
g = map(j, 0, 40, COLOR2_G, COLOR1_G);
b = map(j, 0, 40, COLOR2_B, COLOR1_B);
for (i=0; i < 160; i++) {
strip.setPixelColor(i,(strip.Color(r,g,b) ));
}
strip.show(); // write all the pixels out
delay(300);
}
}