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.
digitalWrite(alarmPin, HIGH); alarmTriggered = true; Serial.println("ALARM! Time to wake up!"); virtuabotixrtc.h arduino library
// 4. Day of week (as number) Serial.print("Day of week (1-7): "); Serial.println(myRTC.dayofweek); Use VirtuabotixRTC if you already have a DS1302
void loop() myRTC.updateTime();