first commit

This commit is contained in:
Jérôme Delacotte
2025-03-06 11:15:32 +01:00
commit 7b30d6e298
5276 changed files with 2108927 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
// DateTime format utility example
#include <Wire.h>
#include <RTClib.h>
DS1307 rtc;
//DS1302 rtc; // see ds1302 example for pin configuration
//DS3231 rtc;
//PCF8563 rtc;
//PCF8583 rtc;
//RTC_Millis rtc;
void setup() {
Serial.begin(9600);
Wire.begin();
rtc.begin();
if (!rtc.isrunning()) {
Serial.println("RTC is NOT running!");
// following line sets the RTC to the date & time this sketch was compiled
rtc.adjust(DateTime(__DATE__, __TIME__));
}
}
void loop() {
DateTime now = rtc.now();
char buf[100];
strncpy(buf, "YYYY.MM.DD hh:mm:ss", 100);
Serial.println(now.format(buf));
delay(1000);
}