/*
* This Arduino Nano ESP32 code was developed by newbiely.com
*
* This Arduino Nano ESP32 code is made available for public use without any restriction
*
* For comprehensive instructions and wiring diagrams, please visit:
* https://newbiely.com/tutorials/arduino-nano-esp32/arduino-nano-esp32-led-matrix
*/
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 32// 4 blocks
#define CS_PIN 5 // The Arduino Nano ESP32 pin connected to the CS pin of the LED matrix
// create an instance of the MD_Parola class
MD_Parola ledMatrix = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
void setup() {
ledMatrix.begin(); // initialize the LED Matrix
ledMatrix.setIntensity(0); // set the brightness of the LED matrix display (from 0 to 15)
ledMatrix.displayClear(); // clear LED matrix display
}
void loop() {
ledMatrix.setTextAlignment(PA_LEFT);
ledMatrix.print("Left"); // display text
delay(2000);
ledMatrix.setTextAlignment(PA_CENTER);
ledMatrix.print("Center"); // display text
delay(2000);
ledMatrix.setTextAlignment(PA_RIGHT);
ledMatrix.print("Right"); // display text
delay(2000);
ledMatrix.setTextAlignment(PA_CENTER);
ledMatrix.setInvert(true);
ledMatrix.print("Invert"); // display text inverted
delay(2000);
ledMatrix.setInvert(false);
ledMatrix.print(1234); // display number
delay(2000);
}