Thread: Switch Latching
View Single Post
  #2   Spotlight this post!  
Unread 04-02-2012, 13:02
j.cole j.cole is offline
Registered User
FRC #0379
 
Join Date: Jan 2010
Location: Girard
Posts: 159
j.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud ofj.cole has much to be proud of
Re: Switch Latching

The way I do it is to use a global variable.

I Use a case structure that is asking for the boolean and every time it turns true the value of the boolean is inverted.

Now in the picture I have it in teleoperated which causes some problems because you can't instantly press and release the button. So it cycles through true and false very quickly and I recommend some way of knowing the value.

Follow the Button Toggle Action example HERE
Attached Thumbnails
Click image for larger version

Name:	Capture.PNG
Views:	52
Size:	3.3 KB
ID:	11702  
__________________

It's not normally a good idea to give a programmer a drill but rules are made to be broken.

Last edited by j.cole : 04-02-2012 at 13:07.
Reply With Quote