void loop() myRTC.updateTime();
Serial.println("RTC Time has been set!");
// Set the time and date manually // Syntax: setDS1302Time(seconds, minutes, hours, dayOfMonth, month, dayOfWeek, year) // NOTE: dayOfWeek: Sunday=1, Monday=2 ... Saturday=7
void setup() pinMode(alarmPin, OUTPUT); digitalWrite(alarmPin, LOW); Serial.begin(9600);
Use VirtuabotixRTC if you already have a DS1302 module and need a 5-minute setup. Use RTClib for long-term, high-accuracy projects. Final Project: Internet-Free Alarm Clock Let's tie everything together with a practical project. This code will turn on an LED (or relay) at a specific time.