void setup() {
// put your setup code here, to run once:
#include <LedControl.h>
const int DIN_PIN = 7;
const int CS_PIN = 6;
const int CLK_PIN = 5;
const byte IMAGES[][8] = {
{
0b11111111,
0b00000000,
0b00000000,
0b10000000,
0b10000000,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b11000000,
0b11000000,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b01100000,
0b01100000,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00110000,
0b00110000,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00011000,
0b00011000,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00001100,
0b00001100,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00000110,
0b00000110,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00000011,
0b00000011,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00000001,
0b00000001,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00000011,
0b00000011,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00000110,
0b00000110,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00011000,
0b00011000,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b00110000,
0b00110000,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b01100000,
0b01100000,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b11000000,
0b11000000,
0b00000000,
0b00000000,
0b11111111
},{
0b11111111,
0b00000000,
0b00000000,
0b10000000,
0b10000000,
0b00000000,
0b00000000,
0b11111111
}};
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, 5);
}
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);
}
Serial.begin(115200);
Serial.println("Hello, ESP32!");
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
}