#include <FastLED.h>
const uint8_t kMatrixWidth = 23;
const uint8_t kMatrixHeight = 13;
#define LED_PIN 3
#define LAST_VISIBLE_LED 114
#define NUM_LEDS (kMatrixWidth*kMatrixHeight)
CRGB leds[NUM_LEDS];
#define MAX_DIMENSION ((kMatrixWidth>kMatrixHeight)? kMatrixWidth: kMatrixHeight)
//Matrix
uint16_t XY (uint16_t x, uint16_t y) {
// any out of bounds address maps to the first hidden pixel
if ( (x >= kMatrixWidth) || (y >= kMatrixHeight) ) {
return (LAST_VISIBLE_LED + 1);
}
const uint16_t XYTable[] = {
132, 131, 130, 129, 128, 127, 126, 4, 125, 3, 124, 2, 123, 1, 122, 0, 121, 120, 119, 118, 117, 116, 115,
133, 134, 135, 136, 137, 138, 5, 139, 6, 140, 7, 141, 8, 142, 9, 143, 10, 144, 145, 146, 147, 148, 149,
165, 164, 163, 162, 161, 17, 160, 16, 159, 15, 158, 14, 157, 13, 156, 12, 155, 11, 154, 153, 152, 151, 150,
166, 167, 168, 169, 18, 170, 19, 171, 20, 172, 21, 173, 22, 174, 23, 175, 24, 176, 25, 177, 178, 179, 180,
194, 193, 192, 34, 191, 33, 190, 32, 189, 31, 188, 30, 187, 29, 186, 28, 185, 27, 184, 26, 183, 182, 181,
195, 196, 35, 197, 36, 198, 37, 199, 38, 200, 39, 201, 40, 202, 41, 203, 42, 204, 43, 205, 44, 206, 207,
219, 55, 218, 54, 217, 53, 216, 52, 215, 51, 214, 50, 213, 49, 212, 48, 211, 47, 210, 46, 209, 45, 208,
56, 220, 57, 221, 58, 222, 59, 223, 60, 224, 61, 225, 62, 226, 63, 227, 64, 228, 65, 229, 66, 230, 67,
242, 78, 241, 77, 240, 76, 239, 75, 238, 74, 237, 73, 236, 72, 235, 71, 234, 70, 233, 69, 232, 68, 231,
79, 243, 80, 244, 81, 245, 82, 246, 83, 247, 84, 248, 85, 249, 86, 250, 87, 251, 88, 252, 89, 253, 90,
269, 268, 267, 266, 265, 97, 264, 96, 263, 95, 262, 94, 261, 93, 260, 92, 259, 91, 258, 257, 256, 255, 254,
270, 271, 272, 273, 98, 274, 99, 275, 100, 276, 101, 277, 102, 278, 103, 279, 104, 280, 105, 281, 282, 283, 284,
298, 297, 296, 114, 295, 113, 294, 112, 293, 111, 292, 110, 291, 109, 290, 108, 289, 107, 288, 106, 287, 286, 285
};
uint16_t i = (y * kMatrixWidth) + x;
uint16_t j = XYTable[i];
return j;
}
// Color correction for the SmartMatrix
#define COLOR_CORRECTION CRGB(255,110,178)
//Patterns
#include "Rainbow.h"
#include "Drops.h"
void setup()
{
// Serial.begin(115200);
FastLED.addLeds<WS2812, LED_PIN, RGB>(leds, NUM_LEDS);
}
void loop()
{
runRainbow();
}
void runRainbow(){
bool isRunning = true;
Rainbow rainbow = Rainbow();
while(isRunning) isRunning = rainbow.runPattern();
}
void runDrops(){
bool isRunning = true;
Drops drops = Drops();
while(isRunning) isRunning = drops.runPattern();
}FPS: 0
Power: 0.00W
Power: 0.00W