Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ****************************
- // ****************************
- // **** UNTESTED ***
- // ****************************
- // ****************************
- //
- //
- // ****************************
- // ****************************
- // **** CANDY CANE COLORS ***
- // *** ANIMATED ***
- // *** VARIABLE SPEED ***
- // ****************************
- // ****************************
- //
- #include "FastLED.h"
- //
- #define DATA_PIN 8
- //
- //#define CLK_PIN 4
- //
- #define NUM_LEDS 100
- //
- CRGB leds[NUM_LEDS];
- // the above creates an LED array to hold
- // the values for each led in your strip
- // Whatever THAT means :)
- //
- // ****************
- // ****************
- // ** VOID SETUP **
- // ****************
- // ****************
- //
- void setup()
- // void setup gets everything ready for what will run in the void loop.
- {
- //
- delay(3000); // 3 second delay for recovery
- //
- FastLED.setBrightness(96);
- //
- FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
- //
- // FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
- // The above is another common type of strip
- // You would comment the WS2812B and uncomment the Neopixel to use it.
- //
- }
- //
- // ***************
- // ***************
- // ** VOID LOOP **
- // ***************
- // ***************
- //
- void loop()
- //
- {
- //****************************************************************************************
- //DOES THE FOLLOWING MAKE THE ANIMATION QUICKER AND QUICKER, THEN BACK TO REGULAR SPEED????
- //****************************************************************************************
- //
- int caneDelay = 1010;
- //
- if (caneDelay > 10)
- {
- caneDelay = caneDelay -10;
- }
- else caneDelay = 1000;
- {
- //
- fill_solid(leds, NUM_LEDS, CHSV(0,255,255) ); // fill entire strip will Red
- for(int i = 0; i < NUM_LEDS; i+=5) //chooses every 5th LED starting at 0
- {
- leds[i] = CHSV(0, 0, 200); //fill every 5th LED with White, with the brightness turned down a little
- }
- for(int i = 1; i < NUM_LEDS; i+=5) //chooses every 5th LED BUT starting at 1
- {
- leds[i] = CHSV(96, 255, 255); //fill every 5th LED with Green
- }
- //
- FastLED.show();
- delay(caneDelay);
- fill_solid(leds, NUM_LEDS, CHSV(0,255,255) ); // fill entire strip will Red
- for(int i = 1; i < NUM_LEDS; i+=5) //chooses every 5th LED starting at 1
- {
- leds[i] = CHSV(0, 0, 200); //fill every 5th LED with White, with the brightness turned down a little
- }
- for(int i = 2; i < NUM_LEDS; i+=5) //chooses every 5th LED BUT starting at 2
- {
- leds[i] = CHSV(96, 255, 255); //fill every 5th LED with Green
- }
- FastLED.show();
- delay(caneDelay);
- fill_solid(leds, NUM_LEDS, CHSV(0,255,255) ); // fill entire strip will Red
- for(int i = 2; i < NUM_LEDS; i+=5) //chooses every 5th LED starting at 2
- {
- leds[i] = CHSV(0, 0, 200); //fill every 5th LED with White, with the brightness turned down a little
- }
- for(int i = 3; i < NUM_LEDS; i+=5) //chooses every 5th LED BUT starting at 3
- {
- leds[i] = CHSV(96, 255, 255); //fill every 5th LED with Green
- }
- FastLED.show();
- delay(caneDelay);
- fill_solid(leds, NUM_LEDS, CHSV(0,255,255) ); // fill entire strip will Red
- for(int i = 3; i < NUM_LEDS; i+=5) //chooses every 5th LED starting at 3
- {
- leds[i] = CHSV(0, 0, 200); //fill every 5th LED with White, with the brightness turned down a little
- }
- for(int i = 4; i < NUM_LEDS; i+=5) //chooses every 5th LED BUT starting at 4
- {
- leds[i] = CHSV(96, 255, 255); //fill every 5th LED with Green
- }
- FastLED.show();
- delay(caneDelay);
- fill_solid(leds, NUM_LEDS, CHSV(0,255,255) ); // fill entire strip will Red
- for(int i = 4; i < NUM_LEDS; i+=5) //chooses every 5th LED starting at 3
- {
- leds[i] = CHSV(0, 0, 200); //fill every 5th LED with White, with the brightness turned down a little
- }
- for(int i = 5; i < NUM_LEDS; i+=5) //chooses every 5th LED BUT starting at 4
- {
- leds[i] = CHSV(96, 255, 255); //fill every 5th LED with Green
- }
- FastLED.show();
- delay(caneDelay);
- }
- //
- }
- //
Advertisement
Add Comment
Please, Sign In to add comment