hi,
i need help.
i found code effect there i need , name is random position fill color, but it just "void loop'' code, no "void setup" or "header".. and also it for neopixel.
please help me add or create missing codes (void setup and header) and how this will work with fastled.
thank you..
void randomPositionFill(uint32_t c, uint8_t wait) {
clearStrip();
int used[dstrip.numPixels()]; // array to keep track of lit LEDs
int lights = 0; // counter
for(int i = 0; i<dstrip.numPixels(); i++){ // fill array with 0
used[i] = 0;
}
while(lights<dstrip.numPixels()-1) {
int j = random(0,dstrip.numPixels()-1); // pick a random LED
if(used[j] != 1){ // if LED not already lit, proceed
dstrip.setPixelColor(j, c);
used[j] = 1; // update array to remember it is lit
lights++;
dstrip.show(); // display
delay(wait);
}
}
}