How to pause a piston


My piston runs when a contact sensor opens but only between certain times. if the contact sensor opens the piston runs but now I don’t want it to run again for 2 min even if the contact sensor opens again.
I tried as you can see a wait but realized if nothing comes after that won’t work
I think if I pause the piston then wait then use resume piston how would it see the resume if its paused
Not sure how to do that


Figured it out


Your wait will be cancelled if the contact triggers again. It can not be used to pause the piston.

You could achieve what you want as below. This will ensure that even if the event fires again, the set level will only be run if it last ran more than 2 mins x 60 secs * 1000 milliseconds ago

if (lastEvent + (2x60x1000) is less than $localNow
with switch
lastEvent = $localNow
set level 40%