#include <FastLED.h>
#define NUM_LEDS 16
#define DATA_PIN 5
CRGB leds[NUM_LEDS];
#include <TimerMs.h>
TimerMs fade(1000, 1, 0); // Fade-in/out ticker
bool lit = 0;
bool ledState = 0;
void setup() {
Serial.begin(115200); // Any baud rate should work
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
}
void loop() {
Serial.println("1");
//armed();
//reset();
}
void armed() {
for (int i = 0; i < 255; i+=1) {
fill_solid(leds, NUM_LEDS, CHSV(65, 0, i));
FastLED.show();
}
for (int i = 255; i > 0; i--) {
fill_solid(leds, NUM_LEDS, CHSV(65, 0, i));
FastLED.show();
}
}
void reset() {
FastLED.clear();
if (fade.tick()) lit = !lit;
if (lit) {
fill_solid(leds, NUM_LEDS, CRGB::Red);
FastLED.show();
} else {
fill_solid(leds, NUM_LEDS, CRGB::Black);
FastLED.show();
}
}