View Single Post
  #1   Spotlight this post!  
Unread 31-12-2014, 17:00
BitTwiddler's Avatar
BitTwiddler BitTwiddler is offline
electronics/programming mentor
AKA: Mr Tanguay
FRC #1726 (N.E.R.D.S.)
Team Role: Mentor
 
Join Date: Oct 2008
Rookie Year: 2006
Location: Sierra Vista, AZ
Posts: 243
BitTwiddler is on a distinguished road
Team 1726 button toggle & SR Latch code

We used these handy little utilities last year and I'd like to be able to re-use the code this year if it comes in handy again. Therefore I am posting the source VI code for other teams to use in the spirit of R13 for the 2015 game.
Button toggle allows the drive team to use a game controller button like a toggle switch. It detects the button press and flips the true/false state of the toggle output to turn something on or off as desired.
SR latch uses one button to set the output to true and second button to reset it back to false.
If you wish to clone multiple copies of these VIs in your code make sure to make them re-entrant to avoid confusion with shared resources.
Hope some other teams also find these useful.
Attached Files
File Type: vi Button Toggle.vi (11.8 KB, 65 views)
File Type: vi s-rflipflop.vi (8.5 KB, 34 views)

Last edited by BitTwiddler : 31-12-2014 at 18:50.
Reply With Quote