#include <FastLED.h>
FASTLED_USING_NAMESPACE
#include <colorpalettes.h>
#include "palettes.h"
#define LED_PIN 15
#define PALETTE_TIME 5
#define cols 16
#define rows 16
#define NUM_LEDS       ((cols) * (rows))

CRGB leds[NUM_LEDS];

#define ANI_FIRE 0
#define ANI_PLASMA 1
uint8_t aniIdx = ANI_PLASMA;// ANI_FIRE;
bool lampeAn = true;
bool autoShutdown = true;
int autoShutdownS = 86400; //= 24h
uint8_t bright;
uint8_t bright_p = 50;
unsigned long msOffset = 0;
//fire variables
int shape = 100; // 20 to 110
int firespeed = 50; // 20 to 100
int intense = 0; // -10 to 0
//
uint8_t iCurrentPal = 11;
uint8_t iTargetPal = iCurrentPal;
const uint8_t numPalettes = sizeof( gradientPalettes) / sizeof( TProgmemRGBGradientPalettePtr );//SIZE(gradientPalettes); //
const uint8_t numAnis = sizeof( animationNames) / sizeof( animationNames[0] );
bool stopAni = false;
unsigned long stopAniTimer;
CRGBPalette16 currentPal = gradientPalettes[iCurrentPal];
CRGBPalette16 targetPal  = gradientPalettes[iTargetPal];
bool paletteActive = true; // if active getColor(h,s,v) returns color from palette as CRGB, otherwise return CHSV(h,s,v)
bool paletteNextAuto = true; // automatic load  iCurrentPal+1 to targetPal after paletteTimeS
 // when off 2 palettes can be loaded at the same time without fade
bool aniNextAuto = false;
bool fadeNow = false;

void setup() {
  Serial.begin(115200);

    // GRB ordering is assumed
setup_leds();

}

void loop() {
main_leds();

}
esp:VIN
esp:GND.2
esp:D13
esp:D12
esp:D14
esp:D27
esp:D26
esp:D25
esp:D33
esp:D32
esp:D35
esp:D34
esp:VN
esp:VP
esp:EN
esp:3V3
esp:GND.1
esp:D15
esp:D2
esp:D4
esp:RX2
esp:TX2
esp:D5
esp:D18
esp:D19
esp:D21
esp:RX0
esp:TX0
esp:D22
esp:D23
neopixels:DOUT
neopixels:VDD
neopixels:VSS
neopixels:DIN