Need help, In my program i want to set IP1 as momentary push button switch to turn OP1 on when IP1 is pressed (from "0" to "1" and back to "0" ) and stay on until IP1 is pressed again (from "0" to "1" and back to "0" ) then turn OP1 off
thanks
Just to be clear the code fragment posted by az1324 transitions on the button being pressed,which is what I assume you want to do. However: the description you wrote implies you do not want output state to change until the button is released. If that is the case need to detect both button press and release states and update OP1 on the transition to 0..
Also: the code fragment needs to test for the button being released or it will toggle OP1 on/off as long as the button is depressed each time WC cycles through user code.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.