#include <RTClib.h>
RTC_DS1307 rtc;
String dayOfTheWeek[7][12] ={"星期日","星期一","星期二","星期三","星期四","星期五","星期六"};
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
if(! rtc.begin()){
Serial.println("找不到RTC");
Serial.flush();
}
}
void loop() {
// put your main code here, to run repeatedly:
DateTime now = rtc.now();
Serial.println(now.toString());
Serial.println(now.dayOfTheWeek());
delay(10); // this speeds up the simulation
}