How to pause a piston


#1

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


#2

Figured it out


#3

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
then
with switch
lastEvent = $localNow
set level 40%