#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
// Which pins on the Arduino are connected to the NeoPixel strips?
#define PIN1 1
#define PIN2 2
#define PIN3 3
#define PIN4 4
#define PIN5 5
#define PIN6 6
#define PIN7 7
#define PIN8 8
#define PIN9 9
#define PIN10 10
#define PIN11 11
#define PIN12 12
// How many NeoPixels are on each strip?
#define NUMPIXELS 10
// When setting up the NeoPixel library, we tell it how many pixels,
// and which pin to use to send signals. Note that for older NeoPixel
// strips you might need to change the third parameter -- see the
// strandtest example for more information on possible values.
Adafruit_NeoPixel strip1(NUMPIXELS, PIN1, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip2(NUMPIXELS, PIN2, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip3(NUMPIXELS, PIN3, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip4(NUMPIXELS, PIN4, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip5(NUMPIXELS, PIN5, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip6(NUMPIXELS, PIN6, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip7(NUMPIXELS, PIN7, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip8(NUMPIXELS, PIN8, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip9(NUMPIXELS, PIN9, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip10(NUMPIXELS, PIN10, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip11(NUMPIXELS, PIN11, NEO_GRB + NEO_KHZ800);
Adafruit_NeoPixel strip12(NUMPIXELS, PIN12, NEO_GRB + NEO_KHZ800);
#define DELAYVAL 1000 // Time (in milliseconds) to pause between pixels
void setup() {
// These lines are specifically to support the Adafruit Trinket 5V 16 MHz.
// Any other board, you can remove this part (but no harm leaving it):
#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000)
clock_prescale_set(clock_div_1);
#endif
// END of Trinket-specific code.
// INITIALIZE NeoPixel strip objects (REQUIRED)
strip1.begin();
strip2.begin();
strip3.begin();
strip4.begin();
strip5.begin();
strip6.begin();
strip7.begin();
strip8.begin();
strip9.begin();
strip10.begin();
strip11.begin();
strip12.begin();
}
void loop() {
// Start with all lights off
strip1.clear();
strip2.clear();
strip3.clear();
strip4.clear();
strip5.clear();
strip6.clear();
strip7.clear();
strip8.clear();
strip9.clear();
strip10.clear();
strip11.clear();
strip12.clear();
// The first NeoPixel in a strand is #0, second is 1, all the way up
// to the count of pixels minus one.
// Set colour for all pixels
int r=25;
int g=206;
int b=230;
for(int i=0-1; i<NUMPIXELS; i++) {
strip1.setPixelColor(i, strip1.Color(r,g,b));
strip2.setPixelColor(i, strip2.Color(r,g,b));
strip3.setPixelColor(i, strip3.Color(r,g,b));
strip4.setPixelColor(i, strip4.Color(r,g,b));
strip5.setPixelColor(i, strip5.Color(r,g,b));
strip6.setPixelColor(i, strip6.Color(r,g,b));
strip7.setPixelColor(i, strip7.Color(r,g,b));
strip8.setPixelColor(i, strip8.Color(r,g,b));
strip9.setPixelColor(i, strip9.Color(r,g,b));
strip10.setPixelColor(i, strip10.Color(r,g,b));
strip11.setPixelColor(i, strip11.Color(r,g,b));
strip12.setPixelColor(i, strip12.Color(r,g,b));
}
// Gradually increase in brightness in three stages
for(int i=255; i>=0; i-85) {
strip1.setBrightness(i);
strip2.setBrightness(i);
strip3.setBrightness(i);
strip4.setBrightness(i);
strip5.setBrightness(i);
strip6.setBrightness(i);
strip7.setBrightness(i);
strip8.setBrightness(i);
strip9.setBrightness(i);
strip10.setBrightness(i);
strip11.setBrightness(i);
strip12.setBrightness(i);
strip1.show();
strip2.show();
strip3.show();
strip4.show();
strip5.show();
strip6.show();
strip7.show();
strip8.show();
strip9.show();
strip10.show();
strip11.show();
strip12.show();
delay(DELAYVAL);
}
// Gradually decrease in brightness in three stages
for(int i=0; i<=255; i+85) {
strip1.setBrightness(i);
strip2.setBrightness(i);
strip3.setBrightness(i);
strip4.setBrightness(i);
strip5.setBrightness(i);
strip6.setBrightness(i);
strip7.setBrightness(i);
strip8.setBrightness(i);
strip9.setBrightness(i);
strip10.setBrightness(i);
strip11.setBrightness(i);
strip12.setBrightness(i);
strip1.show();
strip2.show();
strip3.show();
strip4.show();
strip5.show();
strip6.show();
strip7.show();
strip8.show();
strip9.show();
strip10.show();
strip11.show();
strip12.show();
delay(DELAYVAL);
}
}