Naguissa / uRTCLib

Really tiny library to basic RTC functionality on Arduino. DS1307, DS3231 and DS3232 RTCs are supported.
https://www.foroelectro.net/librerias-arduino-ide-f29/rtclib-arduino-libreria-simple-y-eficaz-para-rtc-y-t95.html
GNU Lesser General Public License v3.0
87 stars 24 forks source link

Alarm exambles #5

Closed tvixen closed 5 years ago

tvixen commented 6 years ago

Hi there And thanks for the great code.

Would it be possible for you to make some alarm examples.

Thanks in advance. Br Tvix

Naguissa commented 6 years ago

Do you mean RTC's alarm or an alarm in a sketch?

tvixen commented 6 years ago

I would appreciate if you could make a test sketch with some alarm examples.

tvixen commented 6 years ago

If you have them in your lib ? (Both alarm 1 and alarm 2)

Naguissa commented 6 years ago

Hello.

About RTC's alarm, it's still not implemented. But remember that output is given by an RTC pin.

About alarm in sketch, it's an use case, it's not part of the library. It consists on checking the RTC value and trigger a pin when correct value is reached. Can be implemented in a lot of different ways inside sketch.

tvixen commented 6 years ago

Yea I just had a look at you library, and there no Alarm code.... Ok, so I must find another lib. Thanks anyway mate.

Naguissa commented 6 years ago

Reading datasheets I'm checking:

DS1307: https://docs-emea.rs-online.com/webdocs/078a/0900766b8078aea1.pdf (page 8, bottom)

It has square output (4 modes) but must be controlled by microcontroller (you need to enable/disable it manually). The control could be added to library in the future.

DS3231: https://datasheets.maximintegrated.com/en/ds/DS3231.pdf (page 11, top)

Has two multimode alarms. This could be added to library in the future.

Also square output can be controlled manually, so also is a convenient thing to add to library.

maxholgasson commented 5 years ago

Hi, is the alarm mode of the ds32312 SQW now supported? Im using the great uRTCLib but would need the alarm feature

Naguissa commented 5 years ago

Hello,

It's still not implemented, I'll do it soon.

But, you know, it works using output pin from RTC, it's not an internal alarm (inside microcontroller).

It's quite easy so it should be available very soon.

Cheers.

maxholgasson commented 5 years ago

Oh cool! Maybe this thread could ne helpful https://forum.arduino.cc/index.php?topic=346940.0

When testing the function and using such a module there needs to be a resistor removed

BracketJohn commented 5 years ago

Hi, are there any news on the alarm function? I love the premise of this lib being small, compared to all other libs for the DS modules, thanks for creating it!

Naguissa commented 5 years ago

Unfortunately I have a lot of work now and also get hurt in my feet; I'll do ASAP, when I have few sparse time.

Naguissa commented 5 years ago

I've created a new major release, 6.0.0: https://github.com/Naguissa/uRTCLib/releases/tag/6.0.0

New features are:

You can see alarms usage on example uRTCLib_example_full.

See .h file to view different support and constants.

Cheers!