#include <FastLED.h> //This is a libeary for the Leds
#define LED_PIN 10
#define NUM_LEDS 16
int offPos;
CRGB leds[NUM_LEDS];
void updateLED(int cuPos) {
offPos = cuPos - 3;
if (offPos < 0) {
offPos += NUM_LEDS;
}
leds[offPos] = CRGB(0, 0, 0);
leds[cuPos] = CRGB(255, 0, 0);
FastLED.show();
}
void setup() {
FastLED.addLeds<WS2812, LED_PIN, GRB>(leds, NUM_LEDS);
}
void loop() {
for (int i = 0; i <= 16; i++) {
updateLED(i);
}
}