Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <FastLED.h>
- #define LED_PIN 17
- // Information about the LED strip
- #define NUM_LEDS 10
- #define CHIPSET WS2811
- #define COLOR_ORDER GRB
- CRGB leds[NUM_LEDS];
- #define BRIGHTNESS 255
- // Variables
- int lead_dot = 0;
- int bpm = 60;
- void loop()
- {
- EVERY_N_MILLISECONDS(300)
- {
- lead_dot = random(NUM_LEDS);
- leds[lead_dot] = CHSV(random(55) + 128, 255, random(128) + 128);
- }
- fadeToBlackBy(leds, lead_dot + 1, (beatsin8(bpm, 0, NUM_LEDS)));
- fadeToBlackBy(leds, lead_dot, (beatsin8(bpm, 0, NUM_LEDS))); // <--change this to 'lead_dot -1' to cause problems with Adafruit CP
- FastLED.show();
- }
- void setup() {
- FastLED.delay( 3000 ); // power-up safety FastLED.delay
- // It's important to set the color correction for your LED strip here,
- // so that colors can be more accurately rendered through the 'temperature' profiles
- FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalSMD5050 );
- //FastLED.setBrightness( BRIGHTNESS );
- }
Advertisement
Add Comment
Please, Sign In to add comment