Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ************************************
- // ************************************
- // *** FIRST I WANT TO RUN IT AS ***
- // *** AN ISOLATED VOID LOOP. THEN ***
- // *** PLAY WITH THE DIFFERENT ***
- // *** VALUES TO SEE WHAT CHANGES ***
- // ************************************
- // ************************************
- //
- #include "FastLED.h"
- #define DATA_PIN 8
- //#define CLK_PIN 4
- #define NUM_LEDS 12
- //
- CRGB leds[NUM_LEDS];
- //
- //
- 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);
- //
- } // END OF VOID SETUP
- //
- void loop()
- //
- {
- static uint16_t lastPixel = 0;
- fadeToBlackBy( leds, NUM_LEDS, 32);
- leds[lastPixel] = CHSV(random8(HUE_BLUE,HUE_PURPLE),255,255);
- lastPixel = random16(NUM_LEDS);
- leds[lastPixel] = CRGB::White;
- FastLED.show();
- }
Advertisement
Add Comment
Please, Sign In to add comment