#include <LiquidCrystal_I2C.h>;
#include <Wire.h>
LiquidCrystal_I2C lcd (0x27, 16,2);
int menit = 0;
int detik1 =6;
int detik2 =4;
int detik3 =3;
void setup() {
lcd.init();
lcd.backlight();
lcd.begin(16,2);
}
void loop() {
lcd.setCursor(5,0);
tampil1();
lcd.setCursor(5,1);
lcd.print("halo");
lcd.clear();
delay(1000);
}
void tampil1 (){
lcd.println((menit < 10? "0" : "") + String(menit)
+ ":" +(detik1 < 10 ? "0" : "")+ String(detik1));
delay(1000);
detik1--;
if (detik1 < 0)
{
detik1=0;
}
}
void tampil2 (){
lcd.println((menit < 10? "0" : "") + String(menit)
+ ":" +(detik2 < 10 ? "0" : "")+ String(detik2));
delay(1000);
detik2--;
if (detik2 < 0)
{
detik2=0;
}
}