From 9ced8bad7861863702c46b9ba5b29dadb5a88d81 Mon Sep 17 00:00:00 2001 From: "David Todd (c0de)" Date: Tue, 24 Jul 2018 21:16:38 -0500 Subject: [PATCH] Add a Struct to manage the pixels --- FIRMWARE/pixo-display/pixo-display-helper.ino | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/FIRMWARE/pixo-display/pixo-display-helper.ino b/FIRMWARE/pixo-display/pixo-display-helper.ino index 71b5cb1..0d1dcc7 100644 --- a/FIRMWARE/pixo-display/pixo-display-helper.ino +++ b/FIRMWARE/pixo-display/pixo-display-helper.ino @@ -21,9 +21,21 @@ uint32_t prevTime = 0; #define DATAPIN 19 #define CLOCKPIN 18 -#define SHIFTDELAY 30 -#define BRIGHTNESS 15 -#define MAX_FPS 45 +define MAX_FPS 45 +#define TOTALPXLS 256 // The total number of LEDs + +// 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( 16, 16, DATAPIN, CLOCKPIN,