Can someone help me out? I want to make an effect like this video.

fastled-support
gplus
(Kyle bostick) #1

Can someone help me out? I want to make an effect like this video. Here is my code, it is running a rainbow effect, I want to have it run select colors, Red Green and White.

if (setEffect == “Cyclon Rainbow”) { //Single Dot Down
static uint8_t hue = 0;
Serial.print(“x”);
// First slide the led in one direction
for(int i = 0; i < NUM_LEDS; i++) {
// Set the i’th led to red
leds[i] = CHSV(hue++, 255, 255);
// Show the leds
FastLED.show();
// now that we’ve shown the leds, reset the i’th led to black
// leds[i] = CRGB::Black;
fadeall();
// Wait a little bit before we loop around and do it again
delay(10);
}
for(int i = (NUM_LEDS)1; i >= 0; i-) {
// Set the i’th led to red
leds[i] = CHSV(hue++, 255, 255);
// Show the leds
FastLED.show();
// now that we’ve shown the leds, reset the i’th led to black
// leds[i] = CRGB::Black;
fadeall();
// Wait a little bit before we loop around and do it again
delay(10);
}

(Marc Miller) #2

@Kyle_bostick Reminder, please post code on http://gist.github.com so it doesn’t get mangled by G+ and it’s readable with line numbers on all devices.

This example might help show how you can choose a color from your own custom list.

(Kyle bostick) #3

Thanks Marc, I got it working, I just am not sure how to tweak the speed of the lights. Can you help me tweak that?

(Marc Miller) #4

Speed change in what way? Did you experiment with changing that delay 40 numbers? You could also have it light up two LEDs at a time and advance twice as fast for example.

Also, comment out any Serial.print statements once you don’t need them for testing any more.

(Kyle bostick) #5

@marmil I want to be able to adjust how fast or slow the LEDs change color down the strip, the delay is how long the color sits at the end before changing and going back in reverse. But the speed it goes down the line is always the same, i’d like to be able to adjust it, i have different lengths LED strips and would like to be able to make them end/reverse at the same time

(allanGEE) #6

Hmmm… (after some unsuccessful attempts with LED strips off eBay) I’ve ordered some Christmas lights from Ray Wu… 6" apart… wonder if I can make a scale model of my house with tiny addressable LEDs to test code. Yes, I’m in over-thinking mode!

(Marc Miller) #7

@allanGEE A scale model would be awesome!