Advertisement
Jim421616

cylon_red

Aug 26th, 2018
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <FastLED.h>
  2. #define NUM_LEDS 30
  3. #define DATA_PIN 13
  4. CRGB leds[NUM_LEDS];
  5.  
  6.  
  7. void setup() {
  8.  
  9. delay(2000);
  10. FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
  11. }
  12.  
  13. void loop() {
  14. for(int whiteLed = 0; whiteLed < NUM_LEDS; whiteLed = whiteLed + 1) {
  15. // Turn our current led on to white, then show the leds
  16. leds[whiteLed] = CRGB::Green;
  17. FastLED.show();
  18. delay(50);
  19. leds[whiteLed] = CRGB::Black;
  20. }
  21. for(int whiteLed = NUM_LEDS; whiteLed > 0; whiteLed = whiteLed - 1) {
  22. // Turn our current led on to white, then show the leds
  23. leds[whiteLed] = CRGB::Green;
  24. FastLED.show();
  25. delay(50);
  26. leds[whiteLed] = CRGB::Black;
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement