Last active
July 2, 2025 13:25
-
-
Save vsizov/645d08543609b5678ed2f1f6ec9ceb21 to your computer and use it in GitHub Desktop.
Revisions
-
vsizov renamed this gist
Jul 2, 2025 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
vsizov created this gist
Jul 2, 2025 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ #include <Wire.h> #include <RTClib.h> #define SDA1_PIN 21 #define SCL1_PIN 22 RTC_DS3231 rtc; void setup() { Wire1.begin(SDA1_PIN, SCL1_PIN); // Initialize Wire1 if (!rtc.begin(&Wire1)) { // Pass Wire1 to RTC Serial.println("Couldn't find RTC"); while (1); } if (rtc.lostPower()) { rtc.adjust(DateTime(2025, 7, 2, 14, 30, 0)); // Set to current time } Serial.begin(115200); DateTime now = rtc.now(); Serial.println(now.timestamp()); } void loop() {}