|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Netbeans programming ONE motor on axis of Logitech Attack 3
Hi All!
Our team only knows how to program the axis on the Logitech Attack 3 if we are working with 2 motors. How would we change the program if we were to only program one motor? Thanks in advance! Green MASHine 4460 |
|
#2
|
|||||
|
|||||
|
Re: Netbeans programming ONE motor on axis of Logitech Attack 3
Motor.setSpeed(joystick.GetRawAxis(1));
Where 1 can be replaced with your joystick axis, joystick can be replaced with your joystick name, and motor with the name of your PWM output. |
|
#3
|
||||
|
||||
|
Re: Netbeans programming ONE motor on axis of Logitech Attack 3
Okay, thanks! I will try it!
|
|
#4
|
||||
|
||||
|
Re: Netbeans programming ONE motor on axis of Logitech Attack 3
Quote:
Pulley.setSpeed(operator.getRawAxis(2)); It is coming up as a wrong command saying: setSpeed(double) is not public in PWM; cannot be accessed from outside package How do I fix this? Thanks |
|
#5
|
|||||
|
|||||
|
Re: Netbeans programming ONE motor on axis of Logitech Attack 3
Whoops, my bad. It's "set" instead of "setSpeed." Try it like that.
EDIT: also, make sure that your pulley is designated as a jaguar, victor, or talon. |
|
#6
|
||||
|
||||
|
Re: Netbeans programming ONE motor on axis of Logitech Attack 3
Quote:
Why would the axis numbers vary? I know because of the x and y axis but would the number for the y axis vary? Thank you |
|
#7
|
|||||
|
|||||
|
Re: Netbeans programming ONE motor on axis of Logitech Attack 3
I'm not quite sure what you mean. Could you please elaborate?
|
|
#8
|
||||
|
||||
|
Re: Netbeans programming ONE motor on axis of Logitech Attack 3
What would the number be for the y-axis? Does the number vary?
|
|
#9
|
|||||
|
|||||
|
Re: Netbeans programming ONE motor on axis of Logitech Attack 3
Ah, ok. Every joystick axis has a number attached attached to it. The joystick.Get command basically checks a database for which axis number matches x, y, z, or the other axis names. I prefer to use getRawAxis because I know exactly the axis number I am calling for. It's really a matter of preference. If you prefer, you can use joystick.getAxis(y) to return the same value.
|
|
#10
|
||||
|
||||
|
Re: Netbeans programming ONE motor on axis of Logitech Attack 3
Quote:
|
|
#11
|
|||||
|
|||||
|
Re: Netbeans programming ONE motor on axis of Logitech Attack 3
The x axis is usually 1, and the y axis is usually 2. Axis 3 is usually the throttle, unless there's a twist axis, like in the Extreme 3D Pro joystick.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|