Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void loop() {
- // put your main code here, to run repeatedly:
- FadeUp();
- }
- void FadeUp(){
- if(leds[NUM_LEDS - 1].g < 255)
- {
- leds[NUM_LEDS - 1].g = (leds[NUM_LEDS - 1].g + 1)*2;
- if(leds[NUM_LEDS - 1].g > 255)
- {
- leds[NUM_LEDS - 1].g = 255;
- }
- }
- for(int i = NUM_LEDS - 2; i>=0; i--)
- {
- if(leds[i+1].g > 2 && leds[i].g < 255)
- {
- leds[i].g = (leds[i].g + 1)*2;
- if(leds[i].g > 255)
- {
- leds[i].g = 255;
- }
- }
- }
- FastLED.show();
- delay(60);
- }
Advertisement
Add Comment
Please, Sign In to add comment