#define FASTLED_ALLOW_INTERRUPTS 0
#include <FastLED.h>
#include "palettes.h"

#define MATRIX  32 //could be 16, 24, 32, 40 and 48
#define DATA_PIN            3
#define NUM_LEDS            ((MATRIX) * (MATRIX))
#define LED_TYPE            WS2811
#define COLOR_ORDER         GRB
int BRIGHTNESS = 180;
CRGB leds[NUM_LEDS];
CRGBPalette16 currentPalette;
#include "functions.h"
void setup()
{
	FastLED.addLeds<LED_TYPE, DATA_PIN, COLOR_ORDER>(leds, NUM_LEDS).setDither(BRIGHTNESS < 255); // cpt-city palettes have different color balance
	FastLED.setBrightness(BRIGHTNESS);
	currentPalette = RainbowColors_p;
	randomSeed(analogRead(A0));
}
void loop()
{
	int random_palette = random(gGradientPaletteCount);
	currentPalette = gGradientPalettes[random_palette];
	int function = random(9);
	switch (function) {
	case 0: pixels_eighth_no_symmetry(); break;
	case 1: pixels_eighth_horizontal_symmetry(); break;
	case 2: pixels_eighth_vertical_symmetry(); break;
	case 3: pixels_eighth_both_symmetry(); break;
	case 4: pixels_quarter_no_symmetry(); break;
	case 5: pixels_quarter_horizontal_symmetry(); break;
	case 6: pixels_quarter_vertical_symmetry(); break;
	case 7: pixels_quarter_both_symmetry(); break;
	case 8: pixels_half_both_symmetry(); break;
	}
	FastLED.show();
	delay(2000);
	fill_solid( leds, NUM_LEDS, CRGB(0,0,0));
}