#include <Adafruit_NeoPixel.h> // library for NeoPixels - only used for testing on WOKWI
#define PIN_NEO_PIXEL 6 // Arduino pin that connects to NeoPixel
#define NUM_PIXELS 64 // The number of LEDs (pixels) on NeoPixel
Adafruit_NeoPixel NeoPixel(NUM_PIXELS, PIN_NEO_PIXEL, NEO_GRB + NEO_KHZ800); // set the NeoPixel (canvas) initialization, only used for WOKWI simulation
// our canvas for pimoroni 11x7px LED matrix display
byte led8x8[] = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0xff, 0xff,
0x00, 0x00, 0x00, 0x00, 0x33, 0xff, 0x33, 0xff,
0x00, 0x00, 0x00, 0x33, 0xff, 0x33, 0x00, 0xff,
0x00, 0x00, 0x33, 0xff, 0x33, 0x00, 0x00, 0xff,
0x00, 0x33, 0xff, 0x33, 0x00, 0x00, 0x00, 0xff,
0x33, 0xff, 0x33, 0x00, 0x00, 0x00, 0x00, 0xff,
0xff, 0x33, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff,
};
byte led8x8off[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
};
void setup() {
NeoPixel.begin(); // initialize the NeoPixel object
// clear neopixels
NeoPixel.clear();
}
void loop() { // main loop
// set all pixel colors to 'off'. It only takes effect if pixels.show() is called
// transfer the content of the 11x7 canvas to neopixels
for (uint8_t pixel = 0; pixel < 64; pixel++) {
NeoPixel.setPixelColor(pixel, NeoPixel.Color(led8x8[pixel], led8x8[pixel], led8x8[pixel]));
}
NeoPixel.show(); // show all the set pixels on neopixel canvas
delay(500);
for (uint8_t pixel = 0; pixel < 64; pixel++) {
NeoPixel.setPixelColor(pixel, NeoPixel.Color(led8x8off[pixel], led8x8off[pixel], led8x8off[pixel]));
}
NeoPixel.show(); // show all the set pixels on neopixel canvas
delay(500);
}