BigEfromDaBx Posted July 3, 2018 Posted July 3, 2018 I want to make an if statement that goes like this if doorlock is open more than 5 mins then do something. How do I do the 5 mins part?
dbuss Posted July 3, 2018 Posted July 3, 2018 Add a "Wait" to your first line in the "Then"Sent from my XT1650 using Tapatalk 1
paulbates Posted July 3, 2018 Posted July 3, 2018 Use Wait, as dbuss suggests. You can also combine that with a repeat statement to keep the reminder coming at regular intervals. It will stop once the door is closed if door is on then wait 5 minutes repeat every 5 minutes send notification 'xxxxx" 2
larryllix Posted July 4, 2018 Posted July 4, 2018 As per Paul's sample program above.... When the door is first switched ON, run the Then section until it finishes. However if the door lock ever becomes NOT ON, then quit running Then at the next Wait or Repeat, and start running Else, code or not. 1
BigEfromDaBx Posted July 4, 2018 Author Posted July 4, 2018 4 hours ago, paulbates said: Use Wait, as dbuss suggests. You can also combine that with a repeat statement to keep the reminder coming at regular intervals. It will stop once the door is closed if door is on then wait 5 minutes repeat every 5 minutes send notification 'xxxxx" This is what I want. I think. So if I forget to lock my door and its open for more than 5 mins then send me a notifications.
BigEfromDaBx Posted July 4, 2018 Author Posted July 4, 2018 1 minute ago, BigEfromDaBx said: This is what I want. I think. So if I forget to lock my door and its open for more than 5 mins then send me a notifications. With the "repeat" statement, what exactly is it repeating. Is it looping the whole if statement?
larryllix Posted July 4, 2018 Posted July 4, 2018 15 minutes ago, BigEfromDaBx said: With the "repeat" statement, what exactly is it repeating. Is it looping the whole if statement? Just the indented line underneath it. If more lines followed they would all be indented and repeated until another "repeat 1 times" is found. 1
BigEfromDaBx Posted July 4, 2018 Author Posted July 4, 2018 1 minute ago, larryllix said: Just the indented line underneath it. If more lines followed they would all be indented and repeated until another "repeat 1 times" is found. Got it. Thanks. 1
Recommended Posts