Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <FastLED.h>
- #if FASTLED_VERSION < 3001000
- #error "Requires FastLED 3.1 or later; check github for latest code."
- #endif
- #define DATA_PIN 2
- #define LED_TYPE NEOPIXEL
- #define COLOR_ORDER GRB
- #define NUM_LEDS 32
- #define BRIGHTNESS 96
- CRGB leds[NUM_LEDS];
- void setup() {
- delay(3000); // 3 second delay for recovery
- // tell FastLED about the LED strip configuration
- FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip).setDither(false);
- FastLED.setBrightness(BRIGHTNESS);
- fill_solid(leds, NUM_LEDS, CRGB::Black);
- FastLED.show();
- }
- // magic happens in here
- void loop()
- {
- fadeToBlackBy( leds, NUM_LEDS, 20);
- leds[beatsin16(20,0,NUM_LEDS)] = CRGB::Red;
- FastLED.show();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement