pushbutton as a slector switch
samsn4
Posts: 49
in a round about way, would this work?
pb - pushbutton input
pb := 0
case pb
1:
if pb == 0
pb := 1
elseif pb == 1
pb := 2
elseif pb == 2
pb := 0
i'm using a keypad and want to cycle through three different modes with one button
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Daniel Mueth
WSIU-TV Master Control
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Just plug it in and let's see what happens"
pb - pushbutton input
pb := 0
case pb
1:
if pb == 0
pb := 1
elseif pb == 1
pb := 2
elseif pb == 2
pb := 0
i'm using a keypad and want to cycle through three different modes with one button
Thanks
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Daniel Mueth
WSIU-TV Master Control
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"Just plug it in and let's see what happens"
Comments
Post Edited (Mike Green) : 12/11/2007 3:22:52 PM GMT
Don't forget to debounce your button some way, either by using a wait count or by waiting for the button to go active and resting before changing your value.
Sorry, I didn't think any one had answered.