This tool serves as a delay of time (pause) between adzan and iqomah (or you can apply for the other function. For example, if the delay is set to 5 minutes then the timer will counting down from minute 5 to 0. In another hand, this tool use Matrix panel P10 as the display.
Hardware Requirement
- Arduino Uno Board
- LED Dot Matrix P10 Module
- Push button
- Power supply +5 Volt
- Jumper
Schematic
Arduino - LED Matrix P10 Wiring
Source Code/Sketch
Source Code/Sketch
#include <SPI.h>
#include <DMD.h>
#include <TimerOne.h>
#include "SystemFont5x7.h"
#include "Arial_black_16.h"
#define DISPLAYS_ACROSS 1
#define DISPLAYS_DOWN 1
DMD dmd(DISPLAYS_ACROSS, DISPLAYS_DOWN);
int menit,detik,i;
char b[8];
String str;
void ScanDMD()
{
dmd.scanDisplayBySPI();
}
void setup()
{
Serial.begin(9600);
Timer1.initialize( 5000 );
Timer1.attachInterrupt( ScanDMD );
dmd.clearScreen( true );
pinMode(2,INPUT);
digitalWrite(2,HIGH);
}
void loop()
{
str="";
menit=2;
while(digitalRead(2));
i=1;
while(i){
if(detik>0){
detik--;
}
else if(detik==0){
detik=59;
if(menit>0){
menit--;
}
else if(menit==0){
detik=0;
i=0;
}
}
dmd.clearScreen( true );
str=String(menit)+":"+String(detik);
str.toCharArray(b,6);
dmd.selectFont(Arial_Black_16);
dmd.drawString( 0, 1, b, 5, GRAPHICS_NORMAL );
delay(1000);
}
}
#include <DMD.h>
#include <TimerOne.h>
#include "SystemFont5x7.h"
#include "Arial_black_16.h"
#define DISPLAYS_ACROSS 1
#define DISPLAYS_DOWN 1
DMD dmd(DISPLAYS_ACROSS, DISPLAYS_DOWN);
int menit,detik,i;
char b[8];
String str;
void ScanDMD()
{
dmd.scanDisplayBySPI();
}
void setup()
{
Serial.begin(9600);
Timer1.initialize( 5000 );
Timer1.attachInterrupt( ScanDMD );
dmd.clearScreen( true );
pinMode(2,INPUT);
digitalWrite(2,HIGH);
}
void loop()
{
str="";
menit=2;
while(digitalRead(2));
i=1;
while(i){
if(detik>0){
detik--;
}
else if(detik==0){
detik=59;
if(menit>0){
menit--;
}
else if(menit==0){
detik=0;
i=0;
}
}
dmd.clearScreen( true );
str=String(menit)+":"+String(detik);
str.toCharArray(b,6);
dmd.selectFont(Arial_Black_16);
dmd.drawString( 0, 1, b, 5, GRAPHICS_NORMAL );
delay(1000);
}
}
How it Works
1. Connect the Arduino with Peripherals needed
2. Plug in the Power Source on the device
3. Compile and upload the script program above to your arduino
4. Press the (START) button (push button) connected with pin 2 Arduino. The timer will start
running. In this example a 2 minute pause is made. You can change the timer in the code easily
Video for Project V - 39. Countdown Timer with Panel Matrix P10 Module (Arduino Based)
Required File
Well Done..! Apperciate
ReplyDeleteperfect..
ReplyDeleteCan this code be changed to be a count up or stopwatch as such ?
ReplyDeletecan i change seconds and make him to 7 min and 30 sec. when i try to change i can only change the minutes on countdown timer
ReplyDeleteHow much is the cost for double
ReplyDelete