Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   throttle (http://www.chiefdelphi.com/forums/showthread.php?t=113853)

tuXguy15 18-02-2013 10:17

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!

2185Bilal 18-02-2013 10:33

Re: throttle
 
Quote:

Originally Posted by Zer0 (Post 1235584)
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)

tuXguy15 18-02-2013 10:35

Re: throttle
 
Ok thanks i will try that

2185Bilal 18-02-2013 10:37

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.

tuXguy15 18-02-2013 15:59

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.


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

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