Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ****************************
- // ****************************
- // **** UNTESTED ***
- // ****************************
- // ****************************
- //
- //
- // ****************************
- // ****************************
- // **** CANDY CANE COLORS ***
- // *** NO ANIMATION ***
- // ****************************
- // ****************************
- //
- #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()
- //
- {
- //
- fill_solid(leds, NUM_LEDS, CHSV(0,255,255) ); // fill entire strip will Red
- //fill_solid(leds, NUM_LEDS, CHSV(random8(),255,255) ); // fill entire strip will random color
- // uint8_t myColor = random8(); //pick a random color
- for(int i = 0; i < NUM_LEDS; i+=5) //chooses every 5th LED starting at 0
- {
- // leds[i] = CHSV(myColor, 255, 255); works with line above to fill random colors
- 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(myColor, 255, 255); works with line above to fill random colors
- leds[i] = CHSV(96, 255, 255); //fill every 5th LED with Green
- }
- FastLED.show();
- //
- }
- //
Advertisement
Add Comment
Please, Sign In to add comment