Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "FastLED.h"
- #define NUM_LEDS 31
- #define DATA_PIN 5
- #define CLOCK_PIN 6
- #define BLUE Red
- #define RED Blue
- #define GREEN Green
- CRGB leds[NUM_LEDS];
- void setup()
- {
- FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
- Serial.begin(9600);
- }
- void loop()
- {
- for (int i = 0; i <= NUM_LEDS; i++)
- {
- leds[i] = CRGB::Fuchsia ;
- FastLED.show();
- delay(30);
- leds[i] = CRGB::Black;
- FastLED.show();
- }
- for (int i = NUM_LEDS; i >= 0; i--)
- {
- leds[i] = CRGB::Fuchsia ;
- FastLED.show();
- delay(30);
- leds[i] = CRGB::Black;
- FastLED.show();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement