So I've been trying to make a fixed amount of LEDs blink at the same time with the same color and then controll the frequency of the blinking LEDs.
Tried to to combine two sketches (Strand Test & Group of LEDs) into one with no success.
Here's what i got:
Code: Select all
#include <Adafruit_NeoPixel.h>
#define PIN 6
Adafruit_NeoPixel strip = Adafruit_NeoPixel(10, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
strip.show(); // Initialize all pixels to 'off'
}
void loop() {
// Some example procedures showing how to display to the pixels:
setGroup(0, strip.Color(255, 0, 0));
setGroup(1, strip.Color(0, 255, 0));
color(strip.Color(0, 0, 0)); // Nada
}
// Group
void setGroup(uint8_t g, uint32_t c) {
int firstPixel = g * 5;
for(uint8_t i=0; i<5; i++) {
strip.setPixelColor(firstPixel + i, c);
strip.show();
delay(500);
}
}
// Fill the dots one after the other with a color
void color(uint32_t c) {
for(uint16_t j=0; j<strip.numPixels(); j++) {
strip.setPixelColor(j, c);
}
}
¿Am i missing a function from the NeoPixel Library?