#define FASTLED_ALLOW_INTERRUPTS 0
#include <FastLED.h>
FASTLED_USING_NAMESPACE
#define DATA_PIN 5 //noted as "D5" on the virtual esp32
#define NUM_LEDS 50
#define LED_TYPE WS2812B
#define COLOR_ORDER GRB
CRGB leds1[NUM_LEDS];//this array represents all available leds (in this example 50)
void setup()
{
delay(1000); // 1 second delay for boot recovery
FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds1, NUM_LEDS).setCorrection( TypicalLEDStrip );
FastLED.setMaxPowerInVoltsAndMilliamps( 3.3, 500);// power limit to prevent port damage
}
void loop()
{
int msec = millis()%1000;// time for pulse run (in seconds), change by 1000 increments
double msecPos = msec/1000.0 * NUM_LEDS;//pulse speed, change by 1000 increments
for(int i = 0; i < NUM_LEDS; i++){
double a = -0.09*(i-msecPos)*(i-msecPos); // adjust the number 0.5 to change the width - smaller number = wider pulse
double y = 150*pow(2, a);// change 255 to adjust brightness
leds1[i] = CRGB(0, (int)y, 0 ); // pulse color
}
FastLED.show();
}