Guest User

Untitled

a guest
Sep 27th, 2016
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.80 KB | None | 0 0
  1. // This #include statement was automatically added by the Particle IDE.
  2. #include "FastLED/FastLED.h"
  3.  
  4. const int frameRate = 30;
  5.  
  6. const int paletteSize = 5 * 16;
  7. using namespace NSFastLED;
  8. const CRGBPalette16 auroraPalette(
  9.   CRGB(20,232,30),
  10.   CRGB(0,234,141),
  11.   CRGB(1,126,213),
  12.   CRGB(181,61,255),
  13.   CRGB(141,0,196),
  14.   CRGB(20,232,30),
  15.   0,
  16.   0,
  17.  
  18.   0,
  19.   0,
  20.   0,
  21.   0,
  22.  
  23.   0,
  24.   0,
  25.   0,
  26.   0
  27. );
  28.  
  29. CRGB led;
  30.  
  31. void setup() {
  32.   // attach our one NeoPixel LED to pin 6
  33.   FastLED.addLeds<NEOPIXEL, 6>(&led, 1);
  34.  
  35.   // so we don't blind ourselves
  36.   FastLED.setBrightness(63);
  37. }
  38.  
  39. void loop() {
  40.   static int index = 0;
  41.   if (++index >= paletteSize) index = 0;
  42.  
  43.   led = ColorFromPalette(auroraPalette, index, 255, LINEARBLEND);
  44.  
  45.   FastLED.show();
  46.   FastLED.delay(1000 / frameRate);
  47. }
Add Comment
Please, Sign In to add comment