#include <Arduino.h>
#include <FastLED.h>
#define MAX_MILLIWATTS 0
#define LED_PIN 2
#define NUM_LEDS 20
#define CHIPSET WS2812B
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
int i = 0;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS);
FastLED.setCorrection(UncorrectedColor);
FastLED.setTemperature(UncorrectedTemperature);
FastLED.setDither(DISABLE_DITHER);
// FastLED.setMaxRefreshRate(400);
if (MAX_MILLIWATTS > 0) FastLED.setMaxPowerInMilliWatts(MAX_MILLIWATTS);
leds[0] = CRGB::Red;
FastLED.show();
}
void loop() {
leds[i] = CRGB::Black;
i++;
if (i >= NUM_LEDS) {
i = 0;
}
leds[i] = CRGB::Red;
FastLED.show();
delay(100);
}