// this module interacts with the hardware on lower level
#include <MD_MAX72xx.h>
// this module helps to display patterns and animations easily
#include <MD_Parola.h>
#include <SPI.h>
const byte clock_pin = 13;
const byte data_pin = 11;
const byte chip_select_pin = 10;
const byte max_devices = 4;
/* creating instance of MD_Parola class :
Hardware type : PAROLA_HW
Max devices : number of devices we are using */
MD_Parola matrix = MD_Parola(MD_MAX72XX::PAROLA_HW, chip_select_pin, max_devices);
void setup()
{
Serial.begin(9600);
Serial.print("What to display?");
matrix.begin(); // initialise the module
matrix.displayClear(); // clear, if there is anything
matrix.displayText("Iffat", // "Text",
PA_CENTER, //alignment
50, //time interval (increse value, descreases speed)
2000, // pause between animation, in and out
PA_SCROLL_LEFT, // effect in
PA_WIPE_CURSOR); // effect out
}
void loop()
{
// displayAnimate() returns true when animation is finished
if (matrix.displayAnimate())
{
// then we reset animaton
matrix.displayReset();
}
}