I'm doing a personal project for lighting up boxes in my wall, and I have an Arduino Nano as the controller and I initialize 9 different strips in the code:
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket
#endif
// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1:
#define LED_PIN1 2
#define LED_PIN2 3
#define LED_PIN3 14
#define LED_PIN4 15
#define LED_PIN5 6
#define LED_PIN6 7
#define LED_PIN7 8
#define LED_PIN8 9
#define LED_PIN9 16
uint8_t index = 0;
uint8_t index2 = 0;
uint8_t index3 = 0;
// How many NeoPixels are attached to the Arduino?
#define LED_COUNT1 21
#define LED_COUNT2 25
#define LED_COUNT3 70
#define LED_COUNT4 95
#define LED_COUNT5 25
#define LED_COUNT6 30
#define LED_COUNT7 75
#define LED_COUNT8 25
#define LED_COUNT9 70
// NeoPixel brightness, 0 (min) to 255 (max)
#define BRIGHTNESS 100 // Set BRIGHTNESS to about 1/5 (max = 255)
Adafruit_NeoPixel strip9(LED_COUNT9, LED_PIN9, NEO_GRBW + NEO_KHZ800);
Adafruit_NeoPixel strip1(LED_COUNT1, LED_PIN1, NEO_GRBW + NEO_KHZ800);
Adafruit_NeoPixel strip2(LED_COUNT2, LED_PIN2, NEO_GRBW + NEO_KHZ800);
Adafruit_NeoPixel strip3(LED_COUNT3, LED_PIN3, NEO_GRBW + NEO_KHZ800);
Adafruit_NeoPixel strip4(LED_COUNT4, LED_PIN4, NEO_GRBW + NEO_KHZ800);
Adafruit_NeoPixel strip5(LED_COUNT5, LED_PIN5, NEO_GRBW + NEO_KHZ800);
Adafruit_NeoPixel strip6(LED_COUNT6, LED_PIN6, NEO_GRBW + NEO_KHZ800);
Adafruit_NeoPixel strip7(LED_COUNT7, LED_PIN7, NEO_GRBW + NEO_KHZ800);
Adafruit_NeoPixel strip8(LED_COUNT8, LED_PIN8, NEO_GRBW + NEO_KHZ800);
void setup() {
strip9.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
strip9.show(); // Turn OFF all pixels ASAP
strip1.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
strip1.show(); // Turn OFF all pixels ASAP
strip2.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
strip2.show(); // Turn OFF all pixels ASAP
strip3.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
strip3.show(); // Turn OFF all pixels ASAP
strip4.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
strip4.show(); // Turn OFF all pixels ASAP
strip5.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
strip5.show(); // Turn OFF all pixels ASAP
strip6.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
strip6.show(); // Turn OFF all pixels ASAP
strip7.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
strip7.show(); // Turn OFF all pixels ASAP
strip8.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
strip8.show(); // Turn OFF all pixels ASAP
}
void loop() {
strip9.fill(strip9.Color(index, index2, index3, strip9.gamma8(255)));
strip1.fill(strip1.Color(index, index2, index3, strip1.gamma8(255)));
strip2.fill(strip2.Color(index, index2, index3, strip2.gamma8(255)));
strip3.fill(strip3.Color(index, index2, index3, strip3.gamma8(255)));
strip4.fill(strip4.Color(index, index2, index3, strip4.gamma8(255)));
strip5.fill(strip5.Color(index, index2, index3, strip5.gamma8(255)));
strip6.fill(strip6.Color(index, index2, index3, strip6.gamma8(255)));
strip7.fill(strip7.Color(index, index2, index3, strip7.gamma8(255)));
strip8.fill(strip8.Color(index, index2, index3, strip8.gamma8(255)));
showStrips();
if (index < 255) {
index++;
}
else if (index2 < 255) {
index2++;
}
else if (index3 < 255) {
index3++;
}
else {
index++;
index2++;
index3++;
}
delay(1);
}
void showStrips() {
strip1.show();
strip2.show();
strip3.show();
strip4.show();
strip5.show();
strip6.show();
strip7.show();
strip8.show();
strip9.show();
}
Each of the strips works individually, but the last strip, in this case strip8, does not change and remains the same color as when it is first initialized. Anyone have any advice on how to fix this issue?