Go Down

Topic: help with TimeAlarm library (Read 309 times) previous topic - next topic

jm_wsb

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

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy