Pages: [1]   Go Down
Author Topic: help with TimeAlarm library  (Read 259 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 61
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

I would like to set an output high and then, after 30 min set it low.

Therefore, I can simply use a timer (<TimeAlarms.h> lib):

set pix x high for sensor Y
AlarmOnce(900,timerswitch)

Now, when the function timerswitch is executed, I need the sensorname (via an array I get the pin) which must be set LOW

SO :
- it is not possible to give a parameter through a function in an alarm mode (fe AlarmOnce(900,timerswitch(sensorY))

The other option is to save the alarmID and sensorname in an array
This way I always now which alarm is active for which sensor.

But when the function timerswitch() is executed after 30 minutes by the alarm, I need to know the alarmID to know the sensorname to put this pin LOW.

Any idea how to get the alarmID in the function executed by the alarm (and yes, I will have many alarms and sensors)

Thanks in advance,
Jeroen
Logged

Pages: [1]   Go Up
Jump to: