/*
* MD_Parola Transitions
* Author: Abran DRozario
*/
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#define HARDWARE_TYPE MD_MAX72XX::PAROLA_HW
#define MAX_DEVICES 4
#define CLK_PIN 13
#define DATA_PIN 11
#define CS_PIN 10
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
struct animations
{
textEffect_t anim_in; // Animation type
textEffect_t anim_out;// Animation type
const char * textOut; // Text to display
uint16_t speed; // Animation speed (multiplier for library default)
uint16_t pause; // pause (multiplier for library default)
textPosition_t just;
};
animations animList[] =
{
{ PA_PRINT, PA_PRINT, "PRINT", 4, 4, PA_CENTER },
{ PA_SCROLL_UP, PA_SCROLL_UP, "SC_U", 4, 4, PA_CENTER },
{ PA_SCROLL_DOWN, PA_SCROLL_DOWN, "SC_D", 4, 4, PA_CENTER },
{ PA_SCROLL_LEFT, PA_SCROLL_LEFT, "SCR_L", 4, 0, PA_LEFT },
{ PA_SCROLL_RIGHT, PA_SCROLL_RIGHT, "SCR_R", 4, 0, PA_LEFT },
{ PA_SPRITE, PA_SPRITE, "SPRIT", 4, 4, PA_CENTER },
{ PA_SLICE, PA_SLICE, "SLICE", 4, 4, PA_CENTER },
{ PA_MESH, PA_MESH, "MESH", 4, 4, PA_CENTER },
{ PA_FADE, PA_FADE, "FADE", 4, 4, PA_CENTER },
{ PA_DISSOLVE, PA_DISSOLVE, "DSLVE", 4, 4, PA_CENTER },
{ PA_BLINDS, PA_BLINDS, "BLIND", 4, 4, PA_CENTER },
{ PA_RANDOM, PA_RANDOM, "RAND", 4, 4, PA_CENTER },
{ PA_WIPE, PA_WIPE, "WIPE", 4, 4, PA_CENTER },
{ PA_WIPE_CURSOR, PA_WIPE_CURSOR, "WPE_C", 4, 4, PA_CENTER },
{ PA_SCAN_HORIZ, PA_SCAN_HORIZ, "SCNH", 4, 4, PA_CENTER },
{ PA_SCAN_HORIZX, PA_SCAN_HORIZX, "SCNHX", 4, 4, PA_CENTER },
{ PA_SCAN_VERT, PA_SCAN_VERT, "SCNV", 4, 4, PA_CENTER },
{ PA_SCAN_VERTX, PA_SCAN_VERTX, "SCNVX", 4, 4, PA_CENTER },
{ PA_OPENING, PA_OPENING, "OPEN", 4, 4, PA_CENTER },
{ PA_CLOSING, PA_CLOSING, "CLOSE", 4, 4, PA_CENTER },
{ PA_OPENING_CURSOR, PA_OPENING_CURSOR, "OPN_C", 4, 4, PA_CENTER },
{ PA_CLOSING_CURSOR, PA_CLOSING_CURSOR, "CLS_C", 4, 4, PA_CENTER },
{ PA_SCROLL_UP_LEFT, PA_SCROLL_UP_LEFT, "SCRUL", 4, 4, PA_CENTER },
{ PA_SCROLL_UP_RIGHT, PA_SCROLL_UP_RIGHT, "SCRUR", 4, 4, PA_CENTER },
{ PA_SCROLL_DOWN_LEFT, PA_SCROLL_DOWN_LEFT, "SCRDL", 4, 4, PA_CENTER },
{ PA_SCROLL_DOWN_RIGHT, PA_SCROLL_DOWN_RIGHT, "SCRDR", 4, 4, PA_CENTER }
};
void setup() {
P.begin();
tone(A3, 880, 20);
for (uint8_t i=0; i<ARRAY_SIZE(animList); i++)
{
animList[i].speed *= P.getSpeed(); animList[i].pause *= 500;
}
}
void loop() {
static uint8_t i = 0; // text effect index
if (P.displayAnimate())// animates and returns true when an animation is completed
{
if (i == ARRAY_SIZE(animList))i = 0; // reset loop index
P.displayText(animList[i].textOut, animList[i].just, animList[i].speed,
animList[i].pause, animList[i].anim_in, animList[i].anim_out);
delay(1000);
i++; // then set up for next text effect
}
}
uno:A5.2
uno:A4.2
uno:AREF
uno:GND.1
uno:13
uno:12
uno:11
uno:10
uno:9
uno:8
uno:7
uno:6
uno:5
uno:4
uno:3
uno:2
uno:1
uno:0
uno:IOREF
uno:RESET
uno:3.3V
uno:5V
uno:GND.2
uno:GND.3
uno:VIN
uno:A0
uno:A1
uno:A2
uno:A3
uno:A4
uno:A5
matrix1:V+
matrix1:GND
matrix1:DIN
matrix1:CS
matrix1:CLK
matrix1:V+.2
matrix1:GND.2
matrix1:DOUT
matrix1:CS.2
matrix1:CLK.2
bz1:1
bz1:2