Problem with TimeAlarms library

Hi Arduino users,

I just have a simple problem with Alarm.delay(...) in TimeAlarms library.

If I setup an alarm to 8 oclock :

Alarm.alarmRepeat(8,30,0, MorningAlarm);  // 8:30am every day

And then, in this alarm I just print "hello" then wait a delay, and print "Goodbye" :

// functions to be called when an alarm triggers:
void MorningAlarm(){
  Serial.println("Hello"); 
  Alarm.delay(TimeToPause);
  Serial.println("Goodbye");    
}

Then, if I defined the wainting time to 10sec all is ok:

int TimeToPause = 10000;

But then, if I defined the waiting time to 50sec, the program wil never say goodbye.. ?? :frowning:

int TimeToPause = 50000;

I modified the TimeAlarms.h example so you can try the program and see the problem (file attached).
http://dl.free.fr/iThLXB76Z
(Of course you need TimeAlarms.h and Time.h library)

Thanks a lot for you help

Hi again,

writing my problem I get a new Idea and solved the problem .. it's just the way I setup my variable

int TimeToPause = 50000;

is not valid, because an integer is smaller than 50000 I gess. changin it by long solve the problem

long TimeToPause = 50000;

Sorry... hope it will help someone.

is not valid, because an integer is smaller than 50000 I gess.

There is no need to guess.