/*I made this code using the LED Matrix Editor on https://xantorohara.github.io/led-matrix-editor/# using "Byte arrays" */ #include const int DIN_PIN = 9; const int CS_PIN = 8; const int CLK_PIN = 5; const byte IMAGES[][8] = { { B00111000, B01101100, B01100000, B11110000, B01100000, B01100000, B11110000, B00000000 },{ B00000000, B00000000, B01111000, B00001100, B01111100, B11001100, B01110110, B00000000 },{ B11100000, B01100000, B01100000, B01111100, B01100110, B01100110, B11011100, B00000000 },{ B01110000, B00110000, B00110000, B00110000, B00110000, B00110000, B01111000, B00000000 },{ B00000000, B00000000, B01111000, B00001100, B01111100, B11001100, B01110110, B00000000 },{ B11100000, B01100000, B01100000, B01111100, B01100110, B01100110, B11011100, B00000000 },{ B00000000, B00000000, B01110110, B11001100, B11001100, B01111100, B00001100, B00011110 },{ B00000000, B00000000, B11011100, B01110110, B01100110, B01100000, B11110000, B00000000 },{ B00000000, B00000000, B01111000, B11001100, B11001100, B11001100, B01111000, B00000000 },{ B00000000, B00111000, B01000100, B01011100, B01011000, B01000010, B00111100, B00000000 },{ B00000000, B00000000, B01111000, B00001100, B01111100, B11001100, B01110110, B00000000 },{ B00000000, B00000000, B11111000, B11001100, B11001100, B11001100, B11001100, B00000000 },{ B00000000, B00000000, B01111000, B00001100, B01111100, B11001100, B01110110, B00000000 },{ B11100000, B01100000, B01101100, B01110110, B01100110, B01100110, B11100110, B00000000 },{ B00000000, B00000000, B11001100, B11001100, B11001100, B11001100, B01110110, B00000000 },{ B00000000, B00000000, B01111000, B00001100, B01111100, B11001100, B01110110, B00000000 },{ B00000000, B00000000, B01111000, B11001100, B11000000, B11001100, B01111000, B00000000 },{ B00000000, B00000000, B00000000, B00000000, B00000000, B01100000, B01100000, B00000000 },{ B00000000, B00000000, B11001100, B11111110, B11111110, B11010110, B11000110, B00000000 },{ B00000000, B00000000, B11000110, B01101100, B00111000, B01101100, B11000110, B00000000 }}; const int IMAGES_LEN = sizeof(IMAGES)/8; LedControl display = LedControl(DIN_PIN, CLK_PIN, CS_PIN); void setup() { display.clearDisplay(0); display.shutdown(0, false); display.setIntensity(0, 8); } void displayImage(const byte* image) { for (int i = 0; i < 8; i++) { for (int j = 0; j < 8; j++) { display.setLed(0, i, j, bitRead(image[i], 7 - j)); } } } int i = 0; void loop() { displayImage(IMAGES[i]); if (++i >= IMAGES_LEN ) { i = 0; } delay(333); }