Go Down

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

jaredc

#130
Nov 22, 2012, 09:49 am Last Edit: Nov 22, 2012, 09:53 am by jaredc Reason: 1
Excuse me if this has been brought up before, but the TimeAlarms library doesn't have Arduino version check and fails on my Arduino. The Time library does, so I just used it as an example to fix my local TimeAlarms library.

In TimeAlarms.cpp:

Code: [Select]
#include <WProgram.h>

in Time.cpp:

Code: [Select]
#if ARDUINO >= 100
#include <Arduino.h>
#else
#include <WProgram.h>
#endif


I will be publishing a how-to for my Arduino project and step one for the end user will be to download the Time/TimeAlarm library, so I don't want them to have problems like i did.

Thanks yall for writing this library, I really enjoy it!

Docedison

Actually the point is of little real interest,. Although it is a good thing that you know how to do it, most who have that issue... Don't come here and post questions.
One thing more the TimeGPS.ino sketch doesn't work. I have one that is working OK but I've not had a chance to post it yet. I did a project that uses a 3.2" 320 X 240 display, a BMP085 barometer and an AMS  2302 hygormeter with TimeGPS for a 'mini' weather station.

Bob
--> WA7EMS <--
"The solution of every problem is another problem." -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

liseman

As per below, the following change should be made to TimeAlarms.cpp :

replace:
#include <WProgram.h>
with:
#if ARDUINO >= 100
#include <Arduino.h>
#else
#include <WProgram.h>
#endif

This change has been made and released in Time.cpp .

2 of the errors I encountered before making this change were:
- In member function 'void TimeAlarmsClass::delay(long unsigned int)':
- error: 'millis' was not declared in this scope

Is there somewhere else I should submit this, too?


Excuse me if this has been brought up before, but the TimeAlarms library doesn't have Arduino version check and fails on my Arduino. The Time library does, so I just used it as an example to fix my local TimeAlarms library.

In TimeAlarms.cpp:

Code: [Select]
#include <WProgram.h>

in Time.cpp:

Code: [Select]
#if ARDUINO >= 100
#include <Arduino.h>
#else
#include <WProgram.h>
#endif


I will be publishing a how-to for my Arduino project and step one for the end user will be to download the Time/TimeAlarm library, so I don't want them to have problems like i did.

Thanks yall for writing this library, I really enjoy it!

Guy-Wittig

Hi

Not sure if you are aware of this, but alarmRepeat does not work for midnight. E.G.

Alarm.alarmRepeat(0,0,0,myHandler); // This does not call myHandler

I found I had to set the alarm for 1 sec past midnight for it to work.

Alarm.alarmRepeat(0,0,1,myHandler); // This does call myHandler


Guy

mem


Not sure if you are aware of this, but alarmRepeat does not work for midnight. E.G.


Hi Guy,

0,0,0 is currently ignored by the alarm code. I am traveling at the moment so can't test any code changes, but you are welcome to try the following:

In the updateNextTrigger() function in TimeAlarms.cpp, change :
  if( (value != 0) && Mode.isEnabled )
to:
  if( Mode.isEnabled )  // remove check for value != 0

Go Up