-->
Page 1 of 1

DS1307 RTC and TimeAlarms: hourly alarm?

PostPosted: Fri Feb 25, 2022 1:27 am
by seattlebiker
Hi all,
I have a question about the clever TimeAlarms library for the DS1307 RTC that is maintained by Paul Stoffregen. I am looking at the readme.txt file, and it apparently can alarm given all kinds of different situations. Except one, it seems. I need to alarm on the hour, daily, i.e., at midnight, 1AM, 2AM, etc. I haven't tried it, but I need something like this: Alarm.alarmRepeat(0-23, 0, 0, getPrecip); The reason for this is I'm in the process of building a rain gauge and I found a node-RED chart node, that can chart hourly rain amounts. It would be great if the TimeAlarms library can do this but maybe I'm stuck with just creating a function using the Time library. Ideas? Thanks!

Re: DS1307 RTC and TimeAlarms: hourly alarm?

PostPosted: Fri Mar 25, 2022 3:01 am
by rpiloverbd
Maybe you cannot set an hourly alarm directly with a library. But you can set the alarm. You can connect a buzzer to a digital pin and make the pin high exactly at particular hours, minutes and seconds.

Re: DS1307 RTC and TimeAlarms: hourly alarm?

PostPosted: Fri Mar 25, 2022 6:41 am
by Inq720
I'm not familiar with the library in question. Since it's RTC, I'm assuming you can get the time, do the Math to find the next top-of-the-hour set an alarm for that. When that alarm goes off (1) kill the first one and create your re-occurring hourly alarm.

VBR,
Inq