Go Down

Topic: Time and TimeAlarms Libraries – Ask here for help or suggestions (Read 225713 times) previous topic - next topic

cattledog

Quote
Yup, I got it to work.
So, I had installed the Arduino originally on my C: drive. And then later at some point  I also installed the IDE on my D: drive.
Once I uninstalled both, reinstalled on C:, I then reimported the libraries and it complied fine.
Good job working your way through this.  :)


brianf53

Hi mem,

I want to record date/time-stamped data every 15 minutes - synchronised to 00, 15, 30, 45 minutes past every hour for (say) 14 days.  Not sure simplest/best way to accomplish this.

Arduino may be powered-up at any time - not necessarily on 15min time-marks

I could use alarmTimerRepeat function, but how to synchronise with 15minute time-marks?

I could use simple logic compare against RTC (does MM = 00, 15, 30 or 45?) to pick 15min time-marks, but this means Arduino will need to read RTC and check for time-marks every second until it finds a match.

I wonder about using the compare for only the initial synch, (ie first time RTC MM = one of the 15min marks), then use alarmTimerRepeat function after that.

I could also count pulses from RTC-SW (1Hz) output ->every 900 pulses, record time-stamped data.

Appreciate your assistance.

UKHeliBob

Why use TimeAlarms for such a simple task ?

Read the time from the RTC and when the minute becomes 0, 15, 30 or 45 log the data

Job done
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

brianf53

Thanks UKHelibob,

This is the 2nd of the 3 options I noted.
I was worried that this will require a lot of processing - checking time every second looking for the occasional match.  Am I worrying about nothing?

UKHeliBob

Quote
Am I worrying about nothing?
Yes

How do you think that TimeAlarms checks whether it is time for action ?
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

Go Up