| #include
#include
LiquidCrystal lcd(13, 12, 5, 4, 3, 2);
void setup() {
Serial.begin(9600);
lcd.begin(16,2);
setTime (00,55,00,24,7,14); //(Jam,Menit,Detik,Tanggal,Bulan,Tahun)
}
void loop(){
//Pertama, Kalender Tahun 2015
if(day() >= 28 && month() == 2 && year() == 15){
setTime(0,0,0,1,3,15); }
else if(day() >= 30 && month() == 4 && year() == 15){
setTime(0,0,0,1,5,15); }
else if(day() >= 30 && month() == 6 && year() == 15){
setTime(0,0,0,1,7,15); }
else if(day() >= 30 && month() == 9 && year() == 15){
setTime(0,0,0,1,10,15); }
else if(day() >= 30 && month() == 11 && year() == 15){
setTime(0,0,0,1,12,15); }
//Kedua, Kalender Tahun 2016
else if(day() >= 29 && month() == 2 && year() == 16){
setTime(0,0,0,1,3,16); }
else if(day() >= 30 && month() == 4 && year() == 16){
setTime(0,0,0,1,5,16); }
else if(day() >= 30 && month() == 6 && year() == 16){
setTime(0,0,0,1,7,16); }
else if(day() >= 30 && month() == 9 && year() == 16){
setTime(0,0,0,1,10,16); }
else if(day() >= 30 && month() == 11 && year() == 16){
setTime(0,0,0,1,12,16); }
//Ketiga, Kalender Tahun 2017
else if(day() >= 28 && month() == 2 && year() == 17){
setTime(0,0,0,1,3,17); }
else if(day() >= 30 && month() == 4 && year() == 17){
setTime(0,0,0,1,5,17); }
else if(day() >= 30 && month() == 6 && year() == 17){
setTime(0,0,0,1,7,17); }
else if(day() >= 30 && month() == 9 && year() == 17){
setTime(0,0,0,1,10,17); }
else if(day() >= 30 && month() == 11 && year() == 17){
setTime(0,0,0,1,12,17); }
//Kemudian, Kelender Tahun 2018
else if(day() >= 28 && month() == 2 && year() == 18){
setTime(0,0,0,1,3,18); }
else if(day() >= 30 && month() == 4 && year() == 18){
setTime(0,0,0,1,5,18); }
else if(day() >= 30 && month() == 6 && year() == 18){
setTime(0,0,0,1,7,18); }
else if(day() >= 30 && month() == 9 && year() == 18){
setTime(0,0,0,1,10,18); }
else if(day() >= 30 && month() == 11 && year() == 18){
setTime(0,0,0,1,12,18); }
//Kemudian, Kelender Tahun 2019
else if(day() >= 28 && month() == 2 && year() == 19){
setTime(0,0,0,1,3,19); }
else if(day() >= 30 && month() == 4 && year() == 19){
setTime(0,0,0,1,5,19); }
else if(day() >= 30 && month() == 6 && year() == 19){
setTime(0,0,0,1,7,19); }
else if(day() >= 30 && month() == 9 && year() == 19){
setTime(0,0,0,1,10,19); }
else if(day() >= 30 && month() == 11 && year() == 19){
setTime(0,0,0,1,12,19); }
//Selanjutnya Kelender Tahun 2020
else if(day() >= 29 && month() == 2 && year() == 20){
setTime(0,0,0,1,3,20); }
else if(day() >= 30 && month() == 4 && year() == 20){
setTime(0,0,0,1,5,20); }
else if(day() >= 30 && month() == 6 && year() == 20){
setTime(0,0,0,1,7,20); }
else if(day() >= 30 && month() == 9 && year() == 20){
setTime(0,0,0,1,10,20); }
else if(day() >= 30 && month() == 11 && year() == 20){
setTime(0,0,0,1,12,20); }
else if(hour() == 0 && minute() == 0 && second() == 0){
lcd.clear();
lcd.print (“Date: “);
printkurangdarinol(day());
lcd.print(“:”);
printkurangdarinol(month());
lcd.print(“:”);
printkurangdarinol(year());
lcd.setCursor(0,1);
lcd.print(“Time: “);
printkurangdarinol(hour());
lcd.print(“:”);
printkurangdarinol(minute());
lcd.print(“:”);
printkurangdarinol(second());
}
lcd.print (“Date: “);
printkurangdarinol(day());
lcd.print(“:”);
printkurangdarinol(month());
lcd.print(“:”);
printkurangdarinol(year());
//
lcd.setCursor(0,1);
lcd.print(“Time: “);
printkurangdarinol(hour());
lcd.print(“:”);
printkurangdarinol(minute());
lcd.print(“:”);
printkurangdarinol(second());
delay (1000);
}
void printkurangdarinol(int data){
if (data >= 0 && data < 10){
lcd.write(‘0’);
}
lcd.print(data);
} |
Warning: Undefined variable $req in /www/wwwroot/blog.indobot.co.id/wp-content/themes/generatepress/functions.php on line 162
Warning: Undefined variable $commenter in /www/wwwroot/blog.indobot.co.id/wp-content/themes/generatepress/functions.php on line 163
Warning: Trying to access array offset on value of type null in /www/wwwroot/blog.indobot.co.id/wp-content/themes/generatepress/functions.php on line 163
Warning: Undefined variable $aria_req in /www/wwwroot/blog.indobot.co.id/wp-content/themes/generatepress/functions.php on line 163
Warning: Undefined variable $req in /www/wwwroot/blog.indobot.co.id/wp-content/themes/generatepress/functions.php on line 167
Warning: Undefined variable $commenter in /www/wwwroot/blog.indobot.co.id/wp-content/themes/generatepress/functions.php on line 168
Warning: Trying to access array offset on value of type null in /www/wwwroot/blog.indobot.co.id/wp-content/themes/generatepress/functions.php on line 168
Warning: Undefined variable $aria_req in /www/wwwroot/blog.indobot.co.id/wp-content/themes/generatepress/functions.php on line 169