// Header file includes
#include <MD_Parola.h>
#include <MD_MAX72xx.h>
#include <Wire.h>
#include "Font7Seg.h"
#define HARDWARE_TYPE MD_MAX72XX::PAROLA_HW
#define MAX_DEVICES 10 // Define the number of displays connected
#define CLK_PIN 52 // CLK or SCK
#define DATA_PIN 51 // DATA or MOSI
#define CS_PIN 53 // CS or SS
#define SPEED_TIME 30 // Speed of the transition
#define PAUSE_TIME 10
#define MAX_MESG 20
#define DS1307_ADDRESS 0x68
uint8_t clear = 0x00;
// Hardware SPI connection
MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);
void beginDS1307()
{
// Read the values (date and time) of the DS1307 module
Wire.beginTransmission(DS1307_ADDRESS);
Wire.write(clear);
Wire.endTransmission();
Wire.requestFrom(DS1307_ADDRESS, 0x07);
}
void setup(void)
{
Serial.begin(9600);
Wire.begin();
P.begin();
pinMode(3, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(3), startText, CHANGE);
}
void startText() {
P.displayText("Domenic", PA_LEFT,SPEED_TIME,PAUSE_TIME, PA_SCROLL_LEFT,PA_SCROLL_LEFT);
}
void loop()
{
beginDS1307();
if(P.displayAnimate())
P.displayText("I LOVE SLEEP", PA_LEFT, SPEED_TIME,PAUSE_TIME, PA_SCROLL_LEFT,PA_SCROLL_LEFT);
}