allanGEE

FastLED trying to figure out Applause Sketch 2016-11-28

Nov 28th, 2016
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. // ************************************
  2. // ************************************
  3. // *** FIRST I WANT TO RUN IT AS ***
  4. // *** AN ISOLATED VOID LOOP. THEN ***
  5. // *** PLAY WITH THE DIFFERENT ***
  6. // *** VALUES TO SEE WHAT CHANGES ***
  7. // ************************************
  8. // ************************************
  9. //
  10. #include "FastLED.h"
  11. #define DATA_PIN 8
  12. //#define CLK_PIN 4
  13. #define NUM_LEDS 12
  14. //
  15. CRGB leds[NUM_LEDS];
  16. //
  17. //
  18. void setup()
  19. // void setup gets everything ready for what will run in the void loop.
  20. {
  21. //
  22. delay(3000); // 3 second delay for recovery
  23. //
  24. //FastLED.setBrightness(96);
  25. //
  26. FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
  27. //
  28. } // END OF VOID SETUP
  29. //
  30. void loop()
  31. //
  32. {
  33. static uint16_t lastPixel = 0;
  34. fadeToBlackBy( leds, NUM_LEDS, 32);
  35. leds[lastPixel] = CHSV(random8(HUE_BLUE,HUE_PURPLE),255,255);
  36. lastPixel = random16(NUM_LEDS);
  37. leds[lastPixel] = CRGB::White;
  38.  
  39. FastLED.show();
  40.  
  41. }
Advertisement
Add Comment
Please, Sign In to add comment