/**********************************************
*** An attempt to change my animations from ***
*** delay to millis, allowing a momentary ***
*** push button to interrupt sequence and ***
*** cycle through animation list. ***
**********************************************/
#include <FastLED.h> // included libraries make
#define VOLTS 5 // max power
#define PWR_LIMIT 500 // 500mA max current
#define LED_PIN 7 // data pin
#define NUM_LEDS 45 // total number of pixels
#define BRIGHTNESS 50 // set brightness level
CRGB leds [NUM_LEDS]; // initialize all pixels
void setup()
{
FastLED.addLeds<WS2812B,LED_PIN,GRB>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
FastLED.setMaxPowerInVoltsAndMilliamps( VOLTS, PWR_LIMIT);
delay(2000); // short delay for recovery
FastLED.setBrightness(BRIGHTNESS);
FastLED.clear();
FastLED.show();
}
void loop()
{
int wait = 50;
for(int i = 0; i < 45; i++){
leds[i] = CRGB::Yellow;
FastLED.show();
delay (wait);
FastLED.show();
}
delay(1000);
for(int i = 0; i < 45; i++){
leds[i] = CRGB::Black;
FastLED.show();
delay (wait);
FastLED.show();
}
delay(1000);
}