#include <SPI.h>
#include <MD_MAX72xx.h>
#include <MD_Parola.h>
#define HARDWARE_TYPE MD_MAX72XX :: FC16_HW
#define MAX_DEVICES 4
#define CLK_PIN 52
#define DATA_IN 51
#define CS_PIN A0
#define ARRAY_SIZE 3
MD_Parola p=MD_Parola(HARDWARE_TYPE,CS_PIN,MAX_DEVICES);
struct animations{
textEffect_t anim_in;
textEffect_t anim_out;
const char* text_out;
uint16_t speed;
uint16_t pause;
textPosition_t just;
};
animations animList [] =
{
{PA_GROW_DOWN,PA_CLOSING_CURSOR,"COOL",2,2,PA_LEFT},
{PA_SCROLL_RIGHT,PA_PRINT,"12",2,2,PA_LEFT},
{PA_SCROLL_LEFT,PA_PRINT,"34",2,2,PA_LEFT},
};
void setup() {
p.begin(); // Initialize display
for(uint8_t i=0;i<ARRAY_SIZE;i++)
{
animList[i].speed *= p.getSpeed();
animList[i].pause *= 500;
}
}
void loop() {
static uint8_t i = 0;
if (p.displayAnimate()) {
if (i == ARRAY_SIZE) {
i = 0;
}
p.displayText(animList[i].text_out, animList[i].just, animList[i].speed, animList[i].pause, animList[i].anim_in, animList[i].anim_out);
delay(500);
i++;
}
}
//p.print("VARSHINI");
//delay(1000);