Pages: 1 ... 5 6 [7]   Go Down
Author Topic: bug in the timealarm library  (Read 8015 times)
0 Members and 1 Guest are viewing this topic.
New River, Arizona
Offline Offline
God Member
*****
Karma: 16
Posts: 907
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Uh, kinda make it hard to test

Code:
TimeAlarmsTest.cpp: In function 'void onAlarm()':
TimeAlarmsTest:37: error: 'class TimeAlarmsClass' has no member named 'getTriggeredAlarmId'
TimeAlarmsTest:51: error: 'class TimeAlarmsClass' has no member named 'free'
TimeAlarmsTest.cpp: In function 'void loop()':
TimeAlarmsTest:137: error: 'class TimeAlarmsClass' has no member named 'getNextTrigger'
Logged

Trying to keep my house under control http://www.desert-home.com/

New River, Arizona
Offline Offline
God Member
*****
Karma: 16
Posts: 907
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Oh, nevermind, found it.
Logged

Trying to keep my house under control http://www.desert-home.com/

Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

same issue, had to find the beta directory first :-)

missing
void TimeAlarmsClass::write(AlarmID_t ID, time_t value,dtAlarmPeriod_t period)
that I added immediatly,

The new isallocated function make code easier to read, but for the sake of my own knowledge, why a function instead of a macro ?


testing tonight and tommorow evening will send you result then.

regards
Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

It is leaking,

I have to see if it is your base code or my modification (new write function)

regards

-------------------------------
Updated:
the dtNBR_ALARMS was back to 6 (from the 8 I am currently using) and that triggered some memory leak, it was there with the previous version and I am not at all sure It come from your sketch, it is probably my code So no issue there, I restart my tests this morning without a memory leak.
« Last Edit: July 06, 2011, 01:09:23 am by viknet » Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 51
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

perfectly working on my side :-)

what about you ?
Logged

New River, Arizona
Offline Offline
God Member
*****
Karma: 16
Posts: 907
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I've had it going in a random fashion from a couple of years back to 5 years forward, starting over when it goes past the upper.  Both timers and alarms have been working fine.  I also ran it once to failure in the future and no problem came up.

I suggest publishing it and let other folk play with it as much as they want to.
Logged

Trying to keep my house under control http://www.desert-home.com/

London
Offline Offline
Faraday Member
**
Karma: 8
Posts: 6240
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for the feedback.

I will create a new zip with the directories in the expected places so its less confusing to install and publish tomorrow for wider testing

Logged

London
Offline Offline
Faraday Member
**
Karma: 8
Posts: 6240
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is a link to the beta Library that fixes the weekly alarm problem. The only change from the code I posted above is the directory structure now matches the old library so the contents can be directly copied into the libraries folder.  I also added this text in a release note:

Quote
Changes made July 5 2011:

This is a beta test version of the libraries that provides a fix for
recurring weekly alarms.

TheTime library is unchanged except for fixes to a macro in Time.h that
converts the number of days to elapsed seconds and the macros that are used
to calculate weekly alarms.

The functionality of the TimeAlarms library has changed slightly in order to
make the library easier to maintain and enhance.

In short, if your application used an Alarm method to create weekly
alarms then you should change your sketch  to use the methods that take the
explicit DayOfWeek parameter. Only the Alarm methods are affected,
Timer methods are as before.

Here are the details:
The previous version could set weekly alarms by calling the AlarmOnce method
with a value greater than one day to indicate the day and time of the weekly
alarm. This has changed and explicit calls to set weekly alarms must be used
when setting weekly alarms. If you were setting weekly alarms by calling either
   Alarm.alarmRepeat(weeklyValue,  AlarmFunction);
then you need to change this to:
  arm.alarmRepeat(DayOfWeek, Hour, Minute, Second,  AlarmFunction);
 
Also the clock must be set to a time on or after Jan1 1971 when using the Alarm methods.
Timer methods are unchanged and will function even if the clock has not been set

Lets see how this goes for a day or so and then I will circulate this more widely

Michael

p.s. viknet, note that I did not add in the enhanced write method. As explained in my earlier post, I think the library is better suited for its intended purpose without it so will need to add into your version.
Logged

London
Offline Offline
Faraday Member
**
Karma: 8
Posts: 6240
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I posted info on the update in a new thread so people would not need to read through the seven pages of background to get to the information on the beta release.

Michael

Logged

Indonesia
Offline Offline
Newbie
*
Karma: 0
Posts: 39
ayooo,,,DAB!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

First, i am noob in arduino and just tinkering arduino.

i make a clock using :
1. Arduino UNO
2. RTC DS1307
3. LCD 16*2

this is how it is work:
==> Visual Basic set RTC time
==> Visual Basic set the Alarm and Save to Arduino EEPROM

and this is the problem that I got:
I have an interval mode alarm, this mode have value to start the alarm, end the alarm, and interval value.
when i compare RTC time and EEPROM value and start the alarm, alarm time is late.
example:
I set the alarm :
- start time : 13.00 pm
- end time : 14.00 pm
- interval :  5 minute

the alarm should 'sound' at 13.05.00 pm (HH.MM.SS), but i get the alarm sound at 13.05.30 and will continue till 14.05.30 pm.

the code is below this post:



Quote
smiley-fat sorry for my englishsmiley-fat

Logged

Indonesia
Offline Offline
Newbie
*
Karma: 0
Posts: 39
ayooo,,,DAB!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

the code:
Quote

deleted
junk detected
« Last Edit: July 11, 2011, 07:54:09 am by copet_pitik » Logged

London
Offline Offline
Faraday Member
**
Karma: 8
Posts: 6240
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

copet_pitik, this thread was reporting a specific issue with the Library so this is not the best place for discussions on help using the library.

I have created a thread for that purpose here and I suggest the we move this discussion there. Can you post a shorter version of your sketch that illustrates the problem so its easer to see if your problem is with Alarms or delays in your code to write to eeprom. It would be easier to help if you can translate comments into english so I can understand the purpose of each of you functions. A summary of the purpose of your sketch and overview of the logic you used to implement it would also help in understanding what your sketch is doing.

Michael
« Last Edit: July 09, 2011, 05:45:54 am by mem » Logged

Indonesia
Offline Offline
Newbie
*
Karma: 0
Posts: 39
ayooo,,,DAB!!!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

copet_pitik, this thread was reporting a specific issue with the Library so this is not the best place for discussions on help using the library.

I have created a thread for that purpose here and I suggest the we move this discussion there. Can you post a shorter version of your sketch that illustrates the problem so its easer to see if your problem is with Alarms or delays in your code to write to eeprom.

Michael

smiley-kitty wokey smiley-kitty
« Last Edit: July 09, 2011, 12:01:00 pm by copet_pitik » Logged

Offline Offline
Jr. Member
**
Karma: 0
Posts: 60
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello, I was wondering if an example could be done that displays all of the alarms at once without using the triggered command and using the read(AlarmID_t ID) method. I just cant seem to be able to get multiple alarms to display their time and that isn't triggered by its own alarm but rather a different alarm solely dedicated in collecting all the alarms at once and printing them. Using the read command from the library, I thought would be able to do this, i just can't figure out how.
Logged

Pages: 1 ... 5 6 [7]   Go Up
Jump to: