When I pass a single 255 value to the allOneColor function, I get the color expected:
255, 0, 0 makes the strip red
0, 255, 0 makes the strip green
0, 0, 255 makes the strip blue
But any time I put a value in the red position, the green and blue values are ignored
100, 255, 0 makes the strip light red, as if it were as 100, 0, 0 (no green shows)
100, 0, 255 again light red, as if 100,0,0 (no blue)
Leaving red at 0, the blue and green are funky as well:
0, 100, 255 makes the strip mostly green, although a little blue is present
This is driving me nuts. Any insight would be appreciated.
Code: Select all
#include <Adafruit_NeoPixel.h>
#define PIN 6
Adafruit_NeoPixel strip = Adafruit_NeoPixel(120, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
void loop() {
allOneColor(strip.Color(0, 255, 0));
}
// Function to change all LEDs to specified color
void allOneColor(uint32_t c) {
for(int i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, c);
}
strip.show();
}