#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <WiFi.h>
#include <NTPClient.h>
#include <WiFiUdp.h>
// LED Matrix
#define HARDWARE_TYPE MD_MAX72XX::PAROLA_HW
#define MAX_DEVICES 4 // 4 blocks
// NTP
#define NTP_SERVER "pool.ntp.org"
#define UTC_OFFSET 8
#define UTC_OFFSET_DST 0
// Software SPI Connections
#define CLK_PIN 0
#define DATA_PIN 15
#define CS_PIN 2
// WIFI
const char *ssid = "Your SSID";
const char *password = "Your Password";
// create an instance of the MD_Parola class
MD_Parola ledMatrix = MD_Parola(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
void setup() {
Serial.begin(115200);
Serial.println();
Serial.println("Startup");
// Time Client Creation
WiFiUDP ntpUDP;
NTPClient timeClient(ntpUDP);
// LED Matrix Initialization
ledMatrix.begin(); // initialize the object
ledMatrix.setIntensity(15); // 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("On Class"); // display text
delay(2000);
ledMatrix.setTextAlignment(PA_CENTER);
ledMatrix.setInvert(false);
ledMatrix.print(1234); // display number
delay(2000);
}