Thread: Button coding
View Single Post
  #8   Spotlight this post!  
Unread 28-02-2016, 13:54
Pratik Kunapuli's Avatar
Pratik Kunapuli Pratik Kunapuli is offline
Probably browning-out on Astro-Turf
FRC #1648 (G3 Robotics)(EWCP)
Team Role: Mentor
 
Join Date: Jan 2013
Rookie Year: 2012
Location: Atlanta, GA
Posts: 143
Pratik Kunapuli is a name known to allPratik Kunapuli is a name known to allPratik Kunapuli is a name known to allPratik Kunapuli is a name known to allPratik Kunapuli is a name known to allPratik Kunapuli is a name known to all
Re: Button coding

Quote:
Originally Posted by Potatonator View Post
Is there any way to set this to run from multiple joysticks? For instance, having button 1 on joystick 1 start and button one on joystick 2 stop it?
You could do it like this:

Code:
if(joystick1.getRawButton(buttonNumber)
{
    speedController.set(1.0);
}
else if(joystick2.getRawButton(buttonNumber)
{
    speedController.set(0.0);
}
__________________
Official Driving Record: 101-59-0
2012-2015 Student 341 Miss Daisy
2015-Current Mentor 1648 G3 Robotics
Reply With Quote