#include "FastLED.h"
#define DATA_PIN 3
#define BRIGHTNESS 255
#define NUM_ROWS 10
#define NUM_COLS 12
#define NUM_LEDS NUM_ROWS * NUM_COLS
CRGB leds[NUM_LEDS];
DEFINE_GRADIENT_PALETTE( firepal ) { // define fire palette
0, 0, 0, 0, //black
32, 255, 0, 0, // red
190, 255, 255, 0, //yellow
255, 255, 255, 255 // white
};
CRGBPalette16 myPal = firepal;
void setup() {
FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
FastLED.setBrightness(BRIGHTNESS);
}
void loop() {
int a = millis();
for (int j = 0; j < NUM_ROWS; j++) {
for (int i = 0; i < NUM_COLS; i++) {
leds[XY(i,j)] = CHSV (sin8(i*8+sin8(i*2+a/9))/2+sin8(j*8+sin8(j*2+a/8)/2),255,255);
}
}
FastLED.delay(5);
}
uint8_t XY (uint8_t x, uint8_t y) { return (y * NUM_COLS + x);} //simple function to find led number in led matrix,
//change this to your routine
//or generate XY function for your matrix there:
//https://macetech.github.io/FastLED-XY-Map-Generator/