#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <RTClib.h>
RTC_DS1307 rtc;
LiquidCrystal_I2C lcd2(0x27, 20, 4);
int Det;
void setup() {
// put your setup code here, to run once:
Wire.begin();
lcd2.init();
lcd2.backlight();
delay(1000);
lcd2.noBacklight();
rtc.begin();
if(!rtc.begin()){lcd2.print("Tidak Aktif");}
if (!rtc.isrunning())(rtc.adjust(DateTime(F(__DATE__),F(__TIME__)));)
}
void loop() {
// put your main code here,ini to run repeatedly:
DateTime now = rtc.now();
Det = now.second();
lcd2.setCursor(4.1);
lcd2.print(Det);
lcd2.print("-");
}