/*
https://forum.arduino.cc/t/odd-unit8-t-decrement-loop-behavior/1261346
*/
#include <FastLED.h>
#define DATA_PIN 4
//#define CLOCK_PIN 5
#define NUM_LEDS 16
#define LED_TYPE WS2811
CRGB leds[NUM_LEDS];
uint8_t i;
uint8_t cnt;
void setup() {
Serial.begin(115200);
FastLED.addLeds<LED_TYPE, DATA_PIN, GRB>(leds, NUM_LEDS);
FastLED.setBrightness(255);
cnt=200;
}
void loop() {
for (i=0;i<NUM_LEDS;i++) {
leds[i]=CHSV(160,255,cnt/2);
}
FastLED.show();
if (cnt > 2){
cnt=cnt-1; } else cnt = 200;
delay(4);
}