Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <FastLED.h>
- #define NUM_LEDS 30
- #define DATA_PIN 13
- CRGB leds[NUM_LEDS];
- void setup() {
- delay(2000);
- FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
- }
- void loop() {
- for(int whiteLed = 0; whiteLed < NUM_LEDS; whiteLed = whiteLed + 1) {
- // Turn our current led on to white, then show the leds
- leds[whiteLed] = CRGB::Green;
- FastLED.show();
- delay(50);
- leds[whiteLed] = CRGB::Black;
- }
- for(int whiteLed = NUM_LEDS; whiteLed > 0; whiteLed = whiteLed - 1) {
- // Turn our current led on to white, then show the leds
- leds[whiteLed] = CRGB::Green;
- FastLED.show();
- delay(50);
- leds[whiteLed] = CRGB::Black;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement