View Single Post
  #1   Spotlight this post!  
Unread 07-02-2017, 15:44
VaneRaklan VaneRaklan is offline
Registered User
FRC #2557 (The SOTABots)
Team Role: Programmer
 
Join Date: Feb 2015
Rookie Year: 2014
Location: Tacoma, WA
Posts: 19
VaneRaklan is an unknown quantity at this point
Re: Using a button to make controls flip

What language are you coding in? Cause that'll affect some things. Regardless the boolean toggle would be the way to go. The way that I coded our Gemini Drive (that's what I've been calling it) is by having the code look at both controllers constantly. For us, if Start and Select are active at the same time then the boolean changes to true thus running drive code altered for one direction and vice versa for the other controller.

So have two sets of drive code that change based on the state of a boolean, and tie thaat boolean to button combinations on the controllers or to some other button.

Here is the link to our code: https://github.com/FIRST-Team-2557-T...team2557/robot
The two files to look at would be ArcadeDrive_cmd and Chassis in the command and subsystem folders respectively. Just in case you'd like to see how we did it. Hope this helps!
Reply With Quote