//
// ESP32 NeoPixel 32x32 Logo Demo - this demo uses four 8x32 panels
// to create a single 32x32 maxtrix.
//
#include <Adafruit_GFX.h>
#include <Adafruit_NeoMatrix.h>
#include <Adafruit_NeoPixel.h>
#define PIN 2
#define DUMMY 999
int Delay = 100;
// Four matrix matrix
Adafruit_NeoMatrix matrix = Adafruit_NeoMatrix(32, 8, 1, 4, PIN,
NEO_MATRIX_TOP + NEO_MATRIX_LEFT + NEO_MATRIX_ROWS + NEO_MATRIX_PROGRESSIVE +
NEO_TILE_TOP + NEO_TILE_LEFT + NEO_TILE_ROWS + NEO_TILE_PROGRESSIVE,
NEO_GRB + NEO_KHZ800);
//
// Setup function
//
void setup() {
Serial.begin(115200);
Serial.println("setup function started.");
matrix.begin();
matrix.setBrightness(255);
Serial.println("calling buildLogo function...");
buildLogo();
Serial.println("setup function completed.");
}
//
// Loop function
//
//
// Define colors
//
uint16_t logoColors[1024];
long rawHexColors[1024] = {
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000002, 0x000003, 0x07070f, 0x0b0d15, 0x010205, 0x000002, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x010206, 0x0f1432, 0x0f1d52, 0x081e55, 0x091d58, 0x0a1e59, 0x0a1e57,
0x0b1d57, 0x091d57, 0x0b1d52, 0x0d193d, 0x0a0d14, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000001, 0x0f1d47, 0x081e58, 0x091e57,
0x091e57, 0x071c56, 0x081d56, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x0a1d56, 0x081e58,
0x0a1e56, 0x0d1f53, 0x0d101b, 0x000100, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x0d1531, 0x0b1e5b, 0x081e58, 0x091e57, 0x091e57, 0x091e57, 0x0a1f58, 0x0d1e4f, 0x0b1e58,
0x091e57, 0x091d57, 0x091e57, 0x091e57, 0x091d58, 0x091e57, 0x091e57, 0x081d58, 0x0f1c44,
0x000001, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x102147, 0x091e57, 0x081e58, 0x091e55, 0x091e57,
0x091e57, 0x091e57, 0x0c2257, 0xfdfcfd, 0x0b1c56, 0x091e57, 0x071e58, 0x091d58, 0x091e58,
0x091d58, 0x081f56, 0x091e57, 0x081e57, 0x0a1d58, 0x0d1c53, 0x06080b, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000002, 0x0d1c46,
0x0a1d58, 0x081e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x0a1d58, 0xfdfdfd,
0xf8fcff, 0x041d51, 0x071e55, 0x212b56, 0xf0f7fc, 0x071a55, 0x0a1e58, 0x091e57, 0x091e57,
0x091e57, 0x0a1d58, 0x0c1d51, 0x030405, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x0b1439, 0x051e53, 0x091e57, 0x091e57, 0x091e57, 0x081e57,
0x071e57, 0x091e57, 0x091e57, 0x071c54, 0xfefefe, 0xfdfdfb, 0xfcffff, 0xfcfdfd, 0xfefcfa,
0x0e1d51, 0x0b2258, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091d58, 0x0c1e4f,
0x010000, 0x000000, 0x000000, 0x000000 , 0x000000, 0x000000, 0x000000, 0x090d16, 0x071d57,
0x091d57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x081e57, 0x0b1e57, 0x15224d, 0xf3fbfe,
0xfefeff, 0xffffff, 0xffffff, 0xfdfffc, 0x6b7690, 0x081f56, 0x091e57, 0x091e57, 0x091e57,
0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x0b1730, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x091d51, 0x0a1d57, 0x091e57, 0x091e57, 0x091e57, 0x091e57,
0x091d58, 0xb7c2d9, 0xfcfdfe, 0xfdfbfc, 0xfefefd, 0xffffff, 0xffffff, 0xffffff, 0xfefefe,
0x0b1e56, 0x0a1d57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57,
0x091e57, 0x091d54, 0x0d0d0f, 0x000000, 0x000000, 0x000000, 0x000000, 0x0d0d16, 0x091e55,
0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e58, 0x0c1f5a, 0x0b1c56,
0x3b4965, 0xfefefe, 0xfdfffe, 0xffffff, 0xfefefe, 0xfafafe, 0x092055, 0x091e57, 0x091e57,
0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091d58, 0x091d58, 0x11163a, 0x000000,
0x000000, 0x000000, 0x000001, 0x0f1d49, 0x091d58, 0x091e57, 0x091e57, 0x091e57, 0x091e57,
0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x081d57, 0xfefefd, 0xfdfdfd, 0x343c5a,
0xeef4fb, 0xfefefe, 0xf4f7fc, 0x061d53, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57,
0x091e57, 0x091e57, 0x091d58, 0x091e60, 0x020202, 0x000000, 0x000000, 0x000000, 0x081c57,
0x091d58, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57,
0x091e57, 0x081e58, 0xfcfdf8, 0xcad5e4, 0x051c53, 0x0a1c56, 0x071a54, 0x091d4d, 0x3a477b,
0x081e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e56, 0x081c57,
0x121216, 0x000000, 0x000000, 0x0a0a0b, 0x081d56, 0x091e57, 0x091e57, 0x091e57, 0x091e57,
0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x0a1f5b, 0xfcfcfd, 0x081d56,
0x091e56, 0x091e57, 0x081d57, 0x0a1d57, 0x071d56, 0x091e57, 0x091e57, 0x091e57, 0x091e57,
0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x0a1d59, 0x0a1429, 0x000000, 0x000000, 0x0d111b,
0x081c57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57,
0x091e57, 0x091e57, 0x091f5a, 0x0f1f56, 0x0a1e58, 0x091d58, 0x091e56, 0x091e57, 0x091e57,
0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57, 0x091e57,
0x091e57, 0x0f1a41, 0x000000, 0x000000, 0x0a1227, 0x081d56, 0x091e56, 0x0a1d55, 0x091e56,
0x091e57, 0x0a1d57, 0x0a1d57, 0x091e57, 0x091e57, 0x0a1d57, 0x091e57, 0x0a1d57, 0x0a1d57,
0x071f55, 0x091d58, 0x0a1d58, 0x0c1c58, 0x0b1c57, 0x0a1d56, 0x0b1c57, 0x0c1c58, 0x0b1d57,
0x0b1d57, 0x0c1c58, 0x0b1c57, 0x0a1d56, 0x0c1c58, 0x081c5b, 0x0e1e4b, 0x000000, 0x000000,
0x37373f, 0xdbe3ef, 0xdce1ef, 0xdde0ef, 0xdce1ef, 0xdce1ef, 0xdce1ef, 0xdce1ef, 0xdce1ef,
0xdce1ef, 0xdde0ef, 0xdce1ef, 0xdbe2ef, 0xdce1ef, 0xdbe0f0, 0x832f54, 0x852e53, 0x843054,
0x843053, 0x843052, 0x843053, 0x843054, 0x843053, 0x843053, 0x843054, 0x843053, 0x843052,
0x853055, 0x892c58, 0x793352, 0x000000, 0x000000, 0x1d1d1d, 0xffffff, 0xffffff, 0xffffff,
0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
0xffffff, 0xfefefd, 0xaf2740, 0xad2740, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742,
0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xb12643, 0x862b3c, 0x000000,
0x000000, 0x0b0b0b, 0xfefefe, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xfdfdfc, 0xaf2640, 0xad2740,
0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742,
0xad2742, 0xad2742, 0xb02542, 0x48131a, 0x000000, 0x000000, 0x000000, 0xffffff, 0xffffff,
0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
0xffffff, 0xffffff, 0xfdfdfc, 0xaf2640, 0xad2740, 0xad2742, 0xad2742, 0xad2742, 0xad2742,
0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xae2642, 0xaa2b40, 0x0e100b,
0x000000, 0x000000, 0x000000, 0xfefefe, 0xfdfdfd, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xfdfdfc, 0xaf2640,
0xad2740, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742,
0xad2742, 0xad2742, 0xac2641, 0xad2644, 0x050505, 0x000000, 0x000000, 0x000000, 0x151515,
0xfefefe, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
0xffffff, 0xffffff, 0xffffff, 0xfdfdfc, 0xaf2640, 0xad2740, 0xad2742, 0xad2742, 0xad2742,
0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xae2643, 0x812839,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xfefefe, 0xfefefe, 0xffffff, 0xffffff,
0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xfdfdfc,
0xaf2640, 0xad2740, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742,
0xad2742, 0xad2742, 0xad2741, 0xad2742, 0x110f0e, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x171717, 0xfefefe, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xfdfdfc, 0xaf2640, 0xad2740, 0xad2742, 0xad2742,
0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xaf2642, 0xad2742, 0xae2440, 0x6f2433,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xe8e8e8, 0xfefefe,
0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
0xfdfdfc, 0xaf2640, 0xad2740, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742,
0xad2742, 0xad2742, 0xae2642, 0xa22c42, 0x020203, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0xfefefe, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xfdfdfc, 0xaf2640, 0xad2740, 0xad2742,
0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2643, 0xaf2642, 0xab2743, 0x100c0c,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0xfefefe, 0xfdfdfd, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff,
0xffffff, 0xfdfdfc, 0xaf2640, 0xad2740, 0xad2742, 0xad2742, 0xad2742, 0xad2742, 0xad2742,
0xae2742, 0xad2844, 0xa92943, 0x150c0d, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0xc4c4c4, 0xfefefe,
0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xffffff, 0xfdfdfc, 0xaf2640, 0xad2740,
0xad2742, 0xad2742, 0xad2742, 0xad2743, 0xad2742, 0xad2841, 0xa23148, 0x0e0808, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x0d0d0d, 0xfafafa, 0xfefefe, 0xffffff, 0xffffff,
0xffffff, 0xffffff, 0xfdfdfc, 0xaf2740, 0xae2841, 0xae2843, 0xaf2744, 0xad2742, 0xb02844,
0xaa2843, 0x340410, 0x000000, 0x010101, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x0a0a0a, 0xededed, 0xfcfcfc, 0xfefefe, 0xfefefe, 0xfdfdfc, 0xaf2640,
0xac2841, 0xad2744, 0xab2841, 0x9c3146, 0x2f090f, 0x010000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x080808, 0x141414, 0x2b090c, 0x1c0307, 0x0d0505, 0x010000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000001, 0x000000, 0x000000, 0x000000, 0x000000,
0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000, 0x000000 };
//
// Loop function
//
void loop() {
Serial.println("At top of loop function.");
for (int loop=0; loop<=31; loop++) {
for (int y=0; y<=31; y++) {
for (int x=0; x<=31; x++) {
int colorIndex = (((y*32) + x) + (loop*32)) % 1024;
//Serial.println("calling drawPixel function.");
matrix.drawPixel(x,y,logoColors[colorIndex]);
}
}
Serial.println("calling matrix.show function.");
matrix.show();
Serial.println("returned from matrix.show function.");
delay(Delay);
}
Serial.println("At bottom of loop function.");
}
void buildLogo() {
int index=0;
long colors;
int colorR;
int colorG;
int colorB;
for (int i=0; i<=1023; i++) {
colors = rawHexColors[index];
colorR = colors / 0x10000;
colors = colors % 0x10000;
colorG = colors / 0x100;
colorB = colors % 0x100;
logoColors[index] = matrix.Color(colorR, colorG, colorB);
index++;
}
}
X Coordinate -->
Y Coordinate -->