#include <RTClib.h>
RTC_DS3231 myRTC;
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
myRTC.begin();
myRTC.adjust(DateTime(F(__DATE__), F(__TIME__)));
// pinMode(2, INPUT_PULLUP);
// pinMode(26, OUTPUT);
}
void loop(){
DateTime now = myRTC.now();
Serial.print(now.year(),DEC);
Serial.print("/");
Serial.print(now.month(),DEC);
Serial.print("/");
Serial.print(now.day(),DEC);
Serial.print(" ");
Serial.print(now.hour(),DEC);
Serial.print(":");
Serial.print(now.minute(),DEC);
Serial.print(":");
Serial.println(now.second(),DEC);
// //put your main code here, to run repeatedly:
// int dataTombol = digitalRead(2);
// Serial.print("Nilai Terbaca :");
// Serial.println(dataTombol);
// if(dataTombol == 0){
// digitalWrite(26, HIGH);
// }
// else{
// digitalWrite(26, LOW);
// }
// // int adcSensor = analogRead(12);
// // Serial.print("Nilai terbaca : ");
// // Serial.println(adcSensor);
delay(1000); // this speeds up the simulation
}