Is there a way to colorwipe fill_rainbow?

fastled-support
gplus
(Christopher Ramey) #1

Is there a way to colorwipe fill_rainbow?

(Jon Burroughs) #2

Not sure what you mean by colorwipe but this will move the rainbow effect through the leds:

void colorwipe()
{
//FastLED event scheduler
EVERY_N_MILLISECONDS( 100 )
{
hue++;
}

//FastLED rainbow function
fill_rainbow( leds, NUM_LEDS, hue, 7);

}

(Christopher Ramey) #3

This part I know, but I don’t want the entire strip to come on at once, but rather one pixel at a time as the fill_rainbow function adjusts hue.

(Ken White) #4

This will provide the colorwipe effect that you are looking for:
void colorwipe_dot(uint8_t chue, uint8_t wait) {
for (int i = 0; i < NUM_LEDS; i++){
leds[i] = CHSV(chue, 255, 255); // chue is the starting color. When 0, you start with red.
FastLED.show();
delay(wait);
chue+=10; // change to get desired rainbow effect depending on how many leds you are using.
}
}

This works well on a 24 led WS2812B ring When chue+=10. In your loop, you could put colorwipe_dot(0,100); which works well on my ring.

(Christopher Ramey) #5

This is exactly what I needed thank you so much :smiley: i put it in setup() and put fill_rainbow in loop to get the effect i was looking for…

void setup() {

delay(1000);

LEDS.addLeds<LED_TYPE, LED_DT, LED_CK, COLOR_ORDER>(leds, NUM_LEDS);

FastLED.setBrightness(max_bright);
set_max_power_in_volts_and_milliamps(5, 500);

colorwipe_dot(0);
}

void loop() {

fill_rainbow(leds, NUM_LEDS, ghue, 1);
ghue–;
FastLED.show();
delay(100/FPS);

}

void colorwipe_dot(uint8_t chue) {
 for (int i = 0; i < NUM_LEDS; i++){
    
    leds[i] = CHSV(chue, 0, 0);  // chue is the starting color. When 0, you start with red.

FastLED.show();


chue+=1; // change to get desired rainbow effect depending on how many leds you are using.
 
 fill_rainbow(leds, i, ghue, 1);
   ghue--;

delay(100/FPS);



}  

}