Add a Struct to manage the pixels

This commit is contained in:
David Todd (c0de) 2018-07-24 21:16:38 -05:00
parent 234bac6ff5
commit 9ced8bad78

View File

@ -21,9 +21,21 @@ uint32_t prevTime = 0;
#define DATAPIN 19 #define DATAPIN 19
#define CLOCKPIN 18 #define CLOCKPIN 18
#define SHIFTDELAY 30 define MAX_FPS 45
#define BRIGHTNESS 15 #define TOTALPXLS 256 // The total number of LEDs
#define MAX_FPS 45
// This structure stores the state of all of the LEDS
// The loop will reset various parts of this, such as the active state
// to allow multiple animations to occurr in a row
struct PXL {
byte id: 1;
byte r: 1;
byte g: 1;
byte b: 1;
byte active: 1;
};
struct PXL pixols[TOTALPXLS];
Adafruit_DotStarMatrix matrix = Adafruit_DotStarMatrix( Adafruit_DotStarMatrix matrix = Adafruit_DotStarMatrix(
16, 16, DATAPIN, CLOCKPIN, 16, 16, DATAPIN, CLOCKPIN,