Guest User

Adafruit Circuit Playground Suicide

a guest
Aug 15th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.00 KB | None | 0 0
  1. #include <FastLED.h>
  2. #define LED_PIN     17
  3.  
  4. // Information about the LED strip
  5. #define NUM_LEDS    10
  6. #define CHIPSET     WS2811
  7. #define COLOR_ORDER GRB
  8. CRGB leds[NUM_LEDS];
  9. #define BRIGHTNESS  255
  10.  
  11. // Variables
  12. int lead_dot = 0;
  13. int bpm = 60;
  14.  
  15. void loop()
  16. {
  17.   EVERY_N_MILLISECONDS(300)
  18.   {
  19.     lead_dot = random(NUM_LEDS);
  20.     leds[lead_dot] = CHSV(random(55) + 128, 255, random(128) + 128);
  21.   }
  22.   fadeToBlackBy(leds, lead_dot + 1, (beatsin8(bpm, 0, NUM_LEDS)));
  23.   fadeToBlackBy(leds, lead_dot, (beatsin8(bpm, 0, NUM_LEDS))); // <--change this to 'lead_dot -1' to cause problems with Adafruit CP
  24.   FastLED.show();
  25. }
  26.  
  27. void setup() {
  28.   FastLED.delay( 3000 ); // power-up safety  FastLED.delay
  29.   // It's important to set the color correction for your LED strip here,
  30.   // so that colors can be more accurately rendered through the 'temperature' profiles
  31.   FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalSMD5050 );
  32.   //FastLED.setBrightness( BRIGHTNESS );
  33.  
  34. }
Advertisement
Add Comment
Please, Sign In to add comment