1) Give a description of the problem
I own a senior care home that is currently using smartthings as a secondary alert system.
Each resident has a smart pendant that is a single press button that turns on a switch to call a nurse for help.
The nurses have buttons as well to reset the switches.
I need to find out how to write a code that uses a “while” type logic.
2) What is the expected behaviour?
I want the nurses pendants to basically be reset buttons that only reset the switch if pressed almost simultaneously with the patients pendant.
I think the logic should read:
if button1 is pressed, turn on switch 1
If button 1 is pressed a timer is started for 3seconds
WHILE the timer is running, if button 7 is pressed, then turn off switch1
else, leave switch1 on.
3) What is happening/not happening?
I have everything figured out except the timer portion. not too sure how that will work.
I know about a Wait action, but i want that wait period to be listening for a button push.
**4) Post a Green Snapshot of the piston!
I don’t have a green snapshot just yet… The whole difficult part for me is the timer portion. not even too sure how to tackle that.
As mentioned, i could throw in a wait action, but i also want to ensure listening to reset pendant presses during the wait.