Hi, I have below blinking LED strip work fine, can anyone share it's integrate with web control on and off the blink.
#include <FastLED.h>
#define NUM_LEDS 300
#define BRIGHTNESS 255
#define LED_TYPE WS2812
#define DATA_PIN 5
CRGB leds[NUM_LEDS];
unsigned long actTime = 0;
unsigned long remTime = 0;
const unsigned long period = 1000;
void setup() {
FastLED.setMaxPowerInVoltsAndMilliamps(5, 1000);
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
FastLED.setBrightness(BRIGHTNESS);
}
bool is_red = false;
void loop() {
actTime = millis();
if (actTime - remTime >= period) {
remTime = actTime;
if (!is_red) {
is_red = true;
fill_solid(leds, NUM_LEDS, CRGB::Red);
FastLED.show();
} else {
is_red = false;
fill_solid(leds, NUM_LEDS, CRGB::Black);
FastLED.show();
}
}
}