Time clock alarm using RTC

#1

Hello everyone I am a total noob to programming :roll_eyes:
I am trying to make a time clock based on the XOD Digital Clock Example https://xod.io/docs/guide/rtc-example/?fbclid=IwAR07C-f8eS6pLlW9Vy4jkXcPzulGQvx3xY9m3lksRl6-LBSSdObJTt2Ttak

The requirements for my project are to set off an alarm at specific times as follows:
Switch a relay output for an air horn solenoid in a certain pattern to signal the end of work shifts.
30 mins later sound the horn again to signal end of break/start of next shift.
Repeat this Monday through Friday.
Account for daylight savings.

So far I have been able to set multiple alarms with the required time delay between shifts and different sound patterns.

My next problem is accounting for daylight savings (DST). I have made a patch to compare the date and time between the values for NZ DST but do not know how to link this to alter the datetime of the RTC to increase the time by 3600 seconds.

I also need to create a patch to trigger alarms from Monday through Friday only.

Any help would be greatly appreciated.

0 Likes

#2

Unfortunately, dealing with day of week and daylight saving time are notoriously difficult. Unless you can find a library to do the calculations for you, you are probably better off doing it manually. You could have a switch to select between DST and STD time. Day of week could be a single digit display (or get fancy with LCD to display day and time) with button to cycle through days to select current day and have code auto update day at midnight.

0 Likes

closed #3

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.

0 Likes

#4

image

0 Likes