//Laboratory 5 - C: Interface a LED Dot Matrix (MAX7219) to an Arduino Mega 2560
//Included libraries
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <SPI.h>
#define HARDWARE_TYPE MD_MAX72XX::PAROLA_HW
#define MAX_DEVICES 11 //11 chains of 8x8 LED dot matrix (MAX7219) is used
//Pin connection of the LED Dot Matrix on the Arduino Mega
#define CLK_PIN 27
#define DATA_PIN 23
#define CS_PIN 25
MD_Parola dotDisplay = MD_Parola(HARDWARE_TYPE, DATA_PIN, CLK_PIN, CS_PIN, MAX_DEVICES);
//Function for displaying name
void name()
{
dotDisplay.print("Your full name");
}
void setup() {
dotDisplay.begin();
}
void loop() {
dotDisplay.setTextAlignment(PA_CENTER); //Alligning text in the center
name();
}