#include<SPI.h> //SPI.h must be included as DMD is written by SPI (the IDE complains otherwise)
#include<DMD.h> //
#include<TimerOne.h> //
#include "SystemFont5x7.h"
#include "Arial_black_16.h"
#include
DS3231 rtc(SDA, SCL);
//Fire up the DMD library as dmd
#define DISPLAYS_ACROSS 1
#define DISPLAYS_DOWN 1
DMD dmd(DISPLAYS_ACROSS, DISPLAYS_DOWN);
void ScanDMD()
{
dmd.scanDisplayBySPI();
}
void setup(void)
{
rtc.begin();
//initialize TimerOne's interrupt/CPU usage used to scan and refresh the display
Timer1.initialize( 5000 ); //period in microseconds to call ScanDMD. Anything longer than 5000 (5ms) and you can see flicker.
Timer1.attachInterrupt( ScanDMD ); //attach the Timer1 interrupt to ScanDMD which goes to dmd.scanDisplayBySPI()
//clear/init the DMD pixels held in RAM
dmd.clearScreen( true ); //true is normal (all pixels off), false is negative (all pixels on)
}
void loop(void)
{
String x=rtc.getDOWStr();
x=x.substring(0,3);
char a[4];
x.toCharArray(a,4);
dmd.selectFont(SystemFont5x7); // Font used
dmd.drawString(8, 3, a,4, GRAPHICS_NORMAL); // Display TEXT SFE
delay(2000);
dmd.clearScreen( true );
x=rtc.getDateStr(); // Display TEXT SF
char b[12];
dmd.selectFont(Arial_Black_16);
x.toCharArray(b,12);
dmd.drawMarquee(b,12,(32*DISPLAYS_ACROSS)-1,0);
long start=millis();
long timer=start;
boolean ret=false;
while(!ret){
if ((timer+40)<millis()) {
ret=dmd.stepMarquee(-1,0);
timer=millis();
}
}
dmd.clearScreen( true );
x=rtc.getTimeStr(); // Display TEXT SF
x=x.substring(0,6);
char c[6];
x.toCharArray(c,6);
dmd.selectFont(SystemFont5x7); // Font used
dmd.drawString(1, 5, c,6, GRAPHICS_NORMAL); // Display TEXT SFE
delay(3000);
// 10 x 14 font clock, including demo of OR and NOR modes for pixels so that the flashing colon can be overlayed
dmd.clearScreen( true );
dmd.selectFont(Arial_Black_16);
dmd.drawMarquee("TECHNO INDIA UNIVERSITY : Celebration Of National Science Day and World Engineering Day For Sustainable Development ",115,(32*DISPLAYS_ACROSS)-1,0);
start=millis();
timer=start;
ret=false;
while(!ret){
if ((timer+40)<millis()) {
ret=dmd.stepMarquee(-1,0);
timer=millis();
}
}
}
#include
#include
#include
#include
#include "SystemFont5x7.h"
#include
SoftDMD dmd(1,1);
// Number of P10 panels used X, Y
// Set Box (dmd, x, y, Height, Width)
DS3231 rtc(SDA, SCL);
void setup() {
// Setup Serial connection
Serial.begin(9600);
// Initialize the rtc object
rtc.begin();
}
void loop(){
DMD_TextBox box(dmd, 1, 1, 32, 16);
dmd.setBrightness(125); // Set brightness 0 - 255
dmd.selectFont(SystemFont5x7); // Font used
dmd.begin(); // Start DMD
//box.print("ECE"); // Display TEXT SFE
const char *MESSAGE = "TECHNO INDIA UNIVERSITY";
const char *next = MESSAGE;
while(*next) {
Serial.print(*next);
box.print(*next);
delay(200);
next++;
}
delay(1000);
DMD_TextBox box8(dmd, 1, 1, 32, 16);
dmd.setBrightness(125); // Set brightness 0 - 255
dmd.selectFont(SystemFont5x7); // Font used
dmd.begin(); // Start DMD
//box.print("ECE"); // Display TEXT SFE
const char *MESSAGE1 = "DEPT.";
const char *next1 = MESSAGE1;
while(*next1) {
Serial.print(*next1);
box8.print(*next1);
delay(200);
next1++;
}
delay(1000);
DMD_TextBox box1(dmd, 6, 1, 32, 16);
// Send Day-of-Week
Serial.print(rtc.getDOWStr());
Serial.print(" ");
String x=rtc.getDOWStr();
dmd.setBrightness(125); // Set brightness 0 - 255
dmd.selectFont(SystemFont5x7); // Font used
dmd.begin(); // Start DMD
box1.print(x.substring(0,3)); // Display TEXT SFE
delay(2000);
DMD_TextBox box2(dmd, 1, 1, 32, 16);
// Send date
Serial.print(rtc.getDateStr());
Serial.print(" -- ");
dmd.setBrightness(125); // Set brightness 0 - 255
dmd.selectFont(SystemFont5x7); // Font used
dmd.begin(); // Start DMD
box2.print(rtc.getDateStr()); // Display TEXT SFE
delay(3000);
DMD_TextBox box3(dmd, 1, 1, 32, 16);
// Send time
Serial.println(rtc.getTimeStr());
x=rtc.getTimeStr();
dmd.setBrightness(125); // Set brightness 0 - 255
dmd.selectFont(SystemFont5x7); // Font used
dmd.begin(); // Start DMD
box3.print(x.substring(0,6)); // Display TEXT SFE
delay(3000);
}