Go to Post Don't bring a distraction to the field. - Al Skierkiewicz [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 18-02-2013, 10:17
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
throttle

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!
Reply With Quote
  #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
  #3   Spotlight this post!  
Unread 18-02-2013, 10:35
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Re: throttle

Ok thanks i will try that
Reply With Quote
  #4   Spotlight this post!  
Unread 18-02-2013, 10:37
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
Thumbs up Re: throttle

no problem

btw, if you need any other explanation and help, do let me know
and ill try my best to help you.
__________________
RAMAZOIDZ

2009 Toronto West Regional - Regional Winners
2009 Waterloo Regional - Regional Winners
Reply With Quote
  #5   Spotlight this post!  
Unread 18-02-2013, 15:59
tuXguy15's Avatar
tuXguy15 tuXguy15 is offline
Team Mentor
AKA: Devin Kolarac
FRC #2559 (Normality Zero)
 
Join Date: Apr 2012
Rookie Year: 2012
Location: Harrisburg, PA
Posts: 127
tuXguy15 is an unknown quantity at this point
Re: throttle

Ok so this worked a little. When the throttle is up then the jaguars dont run and when it is down the jaguars run very slowly. Is there more to it then what I have? Thanks.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 10:14.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi