Thread: throttle
View Single Post
  #2   Spotlight this post!  
Unread 18-02-2013, 10:33
2185Bilal's Avatar
2185Bilal 2185Bilal is offline
Driver, Ld. Programmer, Electrical
AKA: Bilal Majeed
FRC #2185 (Ramazoidz)
Team Role: Programmer
 
Join Date: Feb 2012
Rookie Year: 2011
Location: Toronto, Canada
Posts: 110
2185Bilal will become famous soon enough
Re: throttle

Quote:
Originally Posted by Zer0 View Post
Can someone please help me out with programming a throttle in java/ When i press button 3 on Joystick 2 i want it to read the the throttle and adjust apply that speed to jaguar 3 and jaguar 4. Can you help? Thanks!
here is the code
Code:
if(joystick2.getRawButton(3){
jag3.set(joystick2.getRawAxis(3)); jag4.set(joystick2.getRawAxis(3));
}
explanation:
first line(if button3 is pressed on joystick 2)
2nd line(then set the speed of jaguar 3 to the value from the 3rd axis of the joystick) - the reason why it is 3 is because the throttle axis is 3
3rd line(after that also set jaguar 4 to the same value)
__________________
RAMAZOIDZ

2009 Toronto West Regional - Regional Winners
2009 Waterloo Regional - Regional Winners
Reply With Quote