Jump to content

IF Statement based on amount of time


BigEfromDaBx

Recommended Posts

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"

    

Link to comment

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.

Link to comment
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.

Link to comment
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.

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...