Advertisement
Guest User

Untitled

a guest
Sep 28th, 2016
148
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 = 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. CRGB led[16];
  31.  
  32. void setup() {
  33.   // attach our one NeoPixel LED to pin 6
  34.   FastLED.addLeds<NEOPIXEL, 6>(led, 16);
  35.  
  36.   // so we don't blind ourselves
  37.   FastLED.setBrightness(63);
  38. }
  39.  
  40. void loop() {
  41. for (i = 0;i<15; i++) {
  42.   int colourIndex = index + i;
  43.   if (colourIndex > 15)
  44.     colourIndex -= 15;
  45.   led[i] = ColorFromPalette(auroraPalette, colourIndex , 255, LINEARBLEND);
  46. }
  47.  
  48. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement