Quote:
Originally Posted by WizenedEE
I attached the code we made this year. To use it, just put it in a vi, connect up your momentary button and "switched" output, and then make a shift register and wire that up to the top. The shift register is outside the vi so we can use the same vi many times (if it were inside, the shift register would maintain its values from call to call, not just from loop to loop.)
My vi works fine in teleop; there's a 20ms loop in teleop and your code has a 10ms loop; it's not a big difference. The 20ms actually helps debounce the switch for us.
NOTE: This code is untested in the real world - you might have to do something to debounce switches. I did test it in the vi with the front panel controls though.
|
You can put shift registers or feedback nodes inside the VI if you set it to be reentrant in the VI properties.
Here's how my team does it:
http://forums.usfirst.org/showthread.php?t=10544