Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include <LedControl.h>
const int DIN_PIN = 12;
const int CS_PIN = 10;
const int CLK_PIN = 11;
const uint64_t IMAGES[] PROGMEM = {
0x0000000000000000,
0x0000001818000000, 0x0018245a5a241800, 0x18245aa5a55a2418,
0x245aa54242a55a24, 0x5aa542818142a55a, 0xa5428100008142a5,
0x4281000000008142, 0x8100000000000081, 0x0000000000000000,
0x0000001818000000, 0x0018245a5a241800, 0x18245aa5a55a2418,
0x245aa54242a55a24, 0x5aa542818142a55a, 0xa5428100008142a5,
0x4281000000008142, 0x8100000000000081, 0x0000000000000000,
0x0000001818000000, 0x0018245a5a241800, 0x18245aa5a55a2418,
0x245aa54242a55a24, 0x5aa542818142a55a, 0xa5428100008142a5,
0x4281000000008142, 0x8100000000000081, 0x0000000000000000,
0x8142241818244281, 0xc121121c38488483, 0x6011093a5c908806,
0x300809799e90100c, 0x0804649819262010, 0x02c2241818244340,
0x8142241818244281, 0xc121121c38488483, 0x6011093a5c908806,
0x300809799e90100c, 0x0804649819262010, 0x02c2241818244340,
0x8142241818244281, 0xc121121c38488483, 0x6011093a5c908806,
0x300809799e90100c, 0x0804649819262010, 0x02c2241818244340,
0x9900249999240099, 0xffffc3cbd3c3ffff, 0x80403c3c3c3c0201,
0xffc3bdbdbdbdc3ff, 0x81423c342c3c4281, 0x9900249999240099,
0xffffc3cbd3c3ffff, 0x80403c3c3c3c0201, 0xffc3bdbdbdbdc3ff,
0x81423c342c3c4281, 0x9900249999240099, 0xffffc3cbd3c3ffff,
0x80403c3c3c3c0201, 0xffc3bdbdbdbdc3ff, 0x81423c342c3c4281,
0x0066661018666600, 0xffe7e79999e7e7ff, 0x0066660818666600,
0x3c66e79999e7663c, 0x001818766e181800, 0xbd66e78991e766bd,
0x0018186e76181800, 0xe7e7e70810e7e7e7, 0x0066661018666600,
0xffe7e79999e7e7ff, 0x0066660818666600, 0x3c66e79999e7663c,
0x001818766e181800, 0xbd66e78991e766bd, 0x0018186e76181800,
0xe7e7e70810e7e7e7, 0x0066661018666600, 0xffe7e79999e7e7ff,
0x0066660818666600, 0x3c66e79999e7663c, 0x001818766e181800,
0xbd66e78991e766bd, 0x0018186e76181800, 0xe7e7e70810e7e7e7,
0x0000001818000000, 0x0000241818240000, 0x0066660000666600,
0xa542a50000a542a5, 0x8100000000000081, 0x0000000000000000,
0x0000001818000000, 0x0000241818240000, 0x0066660000666600,
0xa542a50000a542a5, 0x8100000000000081, 0x0000000000000000,
0x8000000000000000,//1
0xc0c0000000000000,
0xe0e0e00000000000,
0xf0f0f0f000000000,
0xf8f8f8f8f8000000,
0xfcfcfcfcfcfc0000,
0xfefefefefefefe00,
0xffffffffffffffff,
0x8000000000000000,
0xc0c0000000000000,
0xe0e0e00000000000,
0xf0f0f0f000000000,
0xf8f8f8f8f8000000,
0xfcfcfcfcfcfc0000,
0xfefefefefefefe00,
0xffffffffffffffff,
0x8000000000000000,
0xc0c0000000000000,
0xe0e0e00000000000,
0xf0f0f0f000000000,
0xf8f8f8f8f8000000,
0xfcfcfcfcfcfc0000,
0xfefefefefefefe00,
0xffffffffffffffff,
0x0100000000000000,//2 6
0x0301000000000000,
0x0703010000000000,
0x0f07030100000000,
0x1f0f070301000000,
0x3f1f0f0703010000,
0x7f3f1f0f07030100,
0xff7f3f1f0f070301,
0x0100000000000000,
0x0302000000000000,
0x0706040000000000,
0x0f0e0c0800000000,
0x1f1e1c1810000000,
0x3f3e3c3830200000,
0x7f7e7c7870604000,
0xfffefcf8f0e0c080,
0x0100000000000000,
0x0301000000000000,
0x0703010000000000,
0x0f07030100000000,
0x1f0f070301000000,
0x3f1f0f0703010000,
0x7f3f1f0f07030100,
0xff7f3f1f0f070301,
0x0100000000000000,
0x0302000000000000,
0x0706040000000000,
0x0f0e0c0800000000,
0x1f1e1c1810000000,
0x3f3e3c3830200000,
0x7f7e7c7870604000,
0xfffefcf8f0e0c080,
0x0100000000000000,
0x0301000000000000,
0x0703010000000000,
0x0f07030100000000,
0x1f0f070301000000,
0x3f1f0f0703010000,
0x7f3f1f0f07030100,
0xff7f3f1f0f070301,
0x0100000000000000,
0x0302000000000000,
0x0706040000000000,
0x0f0e0c0800000000,
0x1f1e1c1810000000,
0x3f3e3c3830200000,
0x7f7e7c7870604000,
0xfffefcf8f0e0c080,
0x0100000000000080,//3
0x03010000000080c0,
0x070301000080c0e0,
0x0f07030180c0e0f0,
0x1f0f0783c1e0f0f8,
0x3f1f8fc7e3f1f8fc,
0x7fbfdfeff7fbfdfe,
0xffffffffffffffff,
0x0100000000000080,
0x03010000000080c0,
0x070301000080c0e0,
0x0f07030180c0e0f0,
0x1f0f0783c1e0f0f8,
0x3f1f8fc7e3f1f8fc,
0x7fbfdfeff7fbfdfe,
0xffffffffffffffff,
0x0100000000000080,
0x03010000000080c0,
0x070301000080c0e0,
0x0f07030180c0e0f0,
0x1f0f0783c1e0f0f8,
0x3f1f8fc7e3f1f8fc,
0x7fbfdfeff7fbfdfe,
0xffffffffffffffff,
0x0000001818000000,//4
0x0000183c3c180000,
0x0000241818240000,
0x00245a3c3c5a2400,
0x0042241818244200,
0x42a55a3c3c5aa542,
0x8142241818244281,
0xc3e77e3c3c7ee7c3,
0x0000001818000000,
0x0000183c3c180000,
0x0000241818240000,
0x00245a3c3c5a2400,
0x0042241818244200,
0x42a55a3c3c5aa542,
0x8142241818244281,
0xc3e77e3c3c7ee7c3,
0x0000001818000000,
0x0000183c3c180000,
0x0000241818240000,
0x00245a3c3c5a2400,
0x0042241818244200,
0x42a55a3c3c5aa542,
0x8142241818244281,
0xc3e77e3c3c7ee7c3,
0x8100000000000081,//5
0x4281000000008142,
0x8142000000004281,
0x42a542000042a542,
0x8142240000244281,
0x42a55a24245aa542,
0x8142241818244281,
0x42a55a3c3c5aa542,
0x8100000000000081,
0x4281000000008142,
0x8142000000004281,
0x42a542000042a542,
0x8142240000244281,
0x42a55a24245aa542,
0x8142241818244281,
0x42a55a3c3c5aa542,
0x8100000000000081,
0x4281000000008142,
0x8142000000004281,
0x42a542000042a542,
0x8142240000244281,
0x42a55a24245aa542,
0x8142241818244281,
0x42a55a3c3c5aa542,
0x0000103818000000,//7
0x0000103838100000,
0x000010383c180000,
0x0000183c3c180000,
0x0010387c3c180000,
0x0010387c7c381000,
0x0010387c7e3c1800,
0x00183c7e7e3c1800,
0x0000103818000000,
0x0000103838100000,
0x000010383c180000,
0x0000183c3c180000,
0x0010387c3c180000,
0x0010387c7c381000,
0x0010387c7e3c1800,
0x00183c7e7e3c1800,
0x0000103818000000,
0x0000103838100000,
0x000010383c180000,
0x0000183c3c180000,
0x0010387c3c180000,
0x0010387c7c381000,
0x0010387c7e3c1800,
0x00183c7e7e3c1800,
0x1824000000000000,//8
0x18245a0000000000,
0x18245a2400000000,
0x18245a245a000000,
0x18245a245a240000,
0x18245a245a245a00,
0x18245a245a245a24,
0x18245a245a245abd,
0x1824000000000000,
0x18245a0000000000,
0x18245a2400000000,
0x18245a245a000000,
0x18245a245a240000,
0x18245a245a245a00,
0x18245a245a245a24,
0x18245a245a245abd,
0x1824000000000000,
0x18245a0000000000,
0x18245a2400000000,
0x18245a245a000000,
0x18245a245a240000,
0x18245a245a245a00,
0x18245a245a245a24,
0x18245a245a245abd,
0x6c28bafed67c3828,//robot
0x82447c7cd6febaaa,
0x36145d7f6b3e1c14,
0x41223e3e6b7f5d55,
0x6c28bafed67c3828,
0x82447c7cd6febaaa,
0x36145d7f6b3e1c14,
0x41223e3e6b7f5d55,
0x6c28bafed67c3828,
0x82447c7cd6febaaa,
0x36145d7f6b3e1c14,
0x41223e3e6b7f5d55,
0x3c7e5f201088c870,//swan
0x78fcbe40201090e0,
0xf0f87c80402020c0,
0xe0f0f80080404080,
0xc0e0f00000808000,
0x80c0e00000000000,
0x0080c00000000000,
0x0000800000000000,
0x0000000000000000,
0x0000000000808000,
0x008080000040c080,
0x80c04080002060c0,
0xc0e0a040801030e0,
0xe0f0d02040889870,
0xf0f8e81020444c38,
0x78fcf4081022261c,
0x3c7efa040811130e,
0x4266767e6e666642,//NKFUST
0x21333b3f37333321,
0x10191d1f1b191910,
0x080c0e0f0d0c0c08,
0x8486878786868684,
0xc2c3c3c3c3c3c3c2,
0x6161e1e1e1616161,
0x3030f0f0f0b03030,
0x1898f8f8f8d89818,
0x8cccfc7c7ceccc8c,
0xc6e67e3e3e76e6c6,
0x63733f1f1f3b7363,
0x31391f0f0f1d3931,
0x181c0f07070e1c18,
0x0c0e070303070e0c,
0x8687838181838786,
0xc3c3c1c0c0c1c3c3,
0x6161e0e06060e1e1,
0x3030f0f03030f0f0,
0x1818f8f81818f8f8,
0x0c0cfcfc0c0cfcfc,
0x06067e7e0606fefe,
0x03033f3f03037f7f,
0x01011f1f01013f3f,
0x00000f0f00001f1f,
0x0000070700000f0f,
0x0080838380808787,
0x80c0c1c1c0c0c3c3,
0xc0e0606060606161,
0xe0f0303030303030,
0xf0f8989898989898,
0x78fccccccccccccc,
0x3c7e666666666666,
0x1e3f333333333333,
0x0f1f191919191919,
0x070f0c0c0c0c0c0c,
0x8387060686868606,
0xc1c30383c3c3c383,
0xe0e101c1e161e1c1,
0xf0f000e0f030f0e0,
0xf8f880f0f818f8f0,
0x7cfcc0f87c0cfcf8,
0x3e7e607c3e067e7c,
0x1e3f303e1f033f3e,
0x0f1f181f0f011f1f,
0x0307060703008787,
0x010303030100c3c3,
0x000101010000e1e1,
0x808080808080f0f0,
0xc0c0c0c0c0c0f8f8,
0x606060606060fcfc,
0x303030303030fefe,
0x181818181818ffff,
0x0c0c0c0c0c0c7f7f,
0x0606060606063f3f,
0x0303030303031f1f,
0x0101010101010f0f,
0x0000000000000707,
0x0000000000000303,
0x0000000000000101,
0x0000000000000000
};
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, 10);
}
void displayImage(uint64_t image) {
for (int i = 0; i < 8; i++) {
byte row = (image >> i * 8) & 0xFF;
for (int j = 0; j < 8; j++) {
display.setLed(0, i, j, bitRead(row, j));
}
}
}
int i = 0;
void loop() {
uint64_t image;
memcpy_P(&image, &IMAGES[i], 8);
displayImage(image);
if (++i >= IMAGES_LEN ) {
i = 0;
}
delay(200);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.