#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));
}
mega:SCL
mega:SDA
mega:AREF
mega:GND.1
mega:13
mega:12
mega:11
mega:10
mega:9
mega:8
mega:7
mega:6
mega:5
mega:4
mega:3
mega:2
mega:1
mega:0
mega:14
mega:15
mega:16
mega:17
mega:18
mega:19
mega:20
mega:21
mega:5V.1
mega:5V.2
mega:22
mega:23
mega:24
mega:25
mega:26
mega:27
mega:28
mega:29
mega:30
mega:31
mega:32
mega:33
mega:34
mega:35
mega:36
mega:37
mega:38
mega:39
mega:40
mega:41
mega:42
mega:43
mega:44
mega:45
mega:46
mega:47
mega:48
mega:49
mega:50
mega:51
mega:52
mega:53
mega:GND.4
mega:GND.5
mega:IOREF
mega:RESET
mega:3.3V
mega:5V
mega:GND.2
mega:GND.3
mega:VIN
mega:A0
mega:A1
mega:A2
mega:A3
mega:A4
mega:A5
mega:A6
mega:A7
mega:A8
mega:A9
mega:A10
mega:A11
mega:A12
mega:A13
mega:A14
mega:A15
neopixels:DOUT
neopixels:VDD
neopixels:VSS
neopixels:DIN