Você está na página 1de 2

/* Simple Project by Giri Cronyos || WWW.CRONYOS.

COM */
/* Jam Sholat Digital LCD 16 x 2 */
#include <LiquidCrystal.h>
LiquidCrystal lcd(2,3,4,6,7,8);
void setup() {
lcd.begin(16, 2);
pinMode(9,INPUT_PULLUP);
pinMode(10,INPUT_PULLUP);
pinMode(11,INPUT_PULLUP);
pinMode(12,INPUT_PULLUP);
}
int detik;
int menit;
int jam;
void loop() {
for (jam = 0;jam<=23;jam++)
{
for (menit=0;menit<=59;menit++)
{
for (detik=0;detik<=59;detik++)
{ if (digitalRead(9)== LOW)
{jam++;}
if (digitalRead(10)== LOW)
{jam--;}
if (digitalRead(11)== LOW)
{menit++;}
if (digitalRead(12)== LOW)
{menit--;}
lcd.setCursor(0,0);
lcd.print("Pukul ");
lcd.print(jam);
lcd.print(":");
lcd.print(menit);
lcd.print(":");
lcd.print(detik);
lcd.print(" ");
delay(1000);
if (detik <= 4){
lcd.setCursor(0,1);
lcd.print("Isya 19:17:00");
lcd.print(" ");
}
else if (detik > 4 && detik <= 8 ){
lcd.setCursor(0,1);
lcd.print("Subuh 04:19:00");
lcd.print(" ");
}
else if (detik > 8 && detik <=12 ){
lcd.setCursor(0,1);
lcd.print("Dhuhur 11:53:00");
lcd.print(" ");
}
else if (detik > 12 && detik <= 16 ){
lcd.setCursor(0,1);
lcd.print("Ashar 15:09:00");
lcd.print(" ");
}
else if (detik > 16 && detik <= 20 ){
lcd.setCursor(0,1);
lcd.print("Magrib 18:06:00");
lcd.print(" ");
}
if (detik >20 && detik <= 24 ){
lcd.setCursor(0,1);
lcd.print("Isya 19:17:00");
lcd.print(" ");
}
else if (detik >24 && detik <= 28 ){
lcd.setCursor(0,1);
lcd.print("Subuh 04:19:00");
lcd.print(" ");
}
else if (detik > 28 && detik <= 32 ){
lcd.setCursor(0,1);
lcd.print("Dhuhur 11:53:00");
lcd.print(" ");
}
else if (detik > 32 && detik <= 36 ){
lcd.setCursor(0,1);
lcd.print("Ashar 15:09:00");
lcd.print(" ");
}
else if (detik > 36 && detik <= 40 ){
lcd.setCursor(0,1);
lcd.print("Magrib 18:06:00");
lcd.print(" ");
}
if (detik > 40 && detik <= 44 ){
lcd.setCursor(0,1);
lcd.print("Isya 19:17:00");
lcd.print(" ");
}
else if (detik > 44 && detik <= 48 ){
lcd.setCursor(0,1);
lcd.print("Subuh 04:19:00");
lcd.print(" ");
}
else if (detik > 48 && detik <= 52 ){
lcd.setCursor(0,1);
lcd.print("Dhuhur 11:53:00");
lcd.print(" ");
}
else if (detik > 52 && detik <= 56 ){
lcd.setCursor(0,1);
lcd.print("Ashar 15:09:00");
lcd.print(" ");
}
else if (detik > 56 && detik <= 60 ){
lcd.setCursor(0,1);
lcd.print("Magrib 18:06:00");
lcd.print(" ");
}
}
}
}
}

Você também pode gostar