Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This #include statement was automatically added by the Particle IDE.
- #include "FastLED/FastLED.h"
- const int frameRate = 30;
- const int paletteSize = 16;
- using namespace NSFastLED;
- const CRGBPalette16 auroraPalette(
- CRGB(20,232,30),
- CRGB(0,234,141),
- CRGB(1,126,213),
- CRGB(181,61,255),
- CRGB(141,0,196),
- CRGB(20,232,30),
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0,
- 0
- );
- //CRGB led;
- CRGB led[16];
- void setup() {
- // attach our one NeoPixel LED to pin 6
- FastLED.addLeds<NEOPIXEL, 6>(led, 16);
- // so we don't blind ourselves
- FastLED.setBrightness(63);
- }
- void loop() {
- static int index = 0;
- if (++index >= paletteSize) index = 0;
- for (i = 0;i<15; i++) {
- int colourIndex = index + i;
- if (colourIndex > 15)
- colourIndex -= 15;
- led[i] = ColorFromPalette(auroraPalette, colourIndex , 255, LINEARBLEND);
- }
- FastLED.show();
- FastLED.delay(1000 / frameRate);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement