Hello,
I've got Arduino UNO + DS3231 RTC + LCD + DHT22 sensor. The task at hand is following:
- Every second update the time on LCD
- Every 5 seconds update readings from DHT22 on LCD.
One restriction is that RTC has to be used: it has an external battery, so time isn't reset on Arduino power off.
And now confusion starts. So I have these three options to go with:
a. Use interrupts: set alarm on RTC to fire every second and on receiving an interrupt update time display and if (seconds%5 == 0) also update the humidity reading.
b. Use watchdog. Basically, same as option a, but watchdog would be source for interrupts. In this approach I particularly don't understand how to synchronise watchdog seconds with RTC seconds.
c. Use loop and RTC. Quite dull approach IMO: in loop() check if the the seconds value returned by RTC has changed and act accordingly.
Since 'c' is very inefficient, could anybody enlighten me on cons and pros of 'a' and 'b' please, and for 'b' in particular - how to sync watchdog with RTC. And even though the whole setup is going to be powered by wall wart, I'd still like to make it a power efficient as possible.
Thanks in advance!