Log in

View Full Version : Netbeans programming ONE motor on axis of Logitech Attack 3


18mfogwell
09-03-2014, 12:06
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

Whippet
09-03-2014, 12:22
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.

18mfogwell
09-03-2014, 12:26
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.

Okay, thanks! I will try it!

18mfogwell
09-03-2014, 12:30
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.

So I have

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

Whippet
09-03-2014, 12:47
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.

18mfogwell
09-03-2014, 12:49
Whoops, my bad. It's "set" instead of setSpeed. Try it like that.

Okay. That works.

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

Whippet
09-03-2014, 12:54
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

I'm not quite sure what you mean. Could you please elaborate?

18mfogwell
09-03-2014, 12:57
I'm not quite sure what you mean; could you please elaborate?

What would the number be for the y-axis? Does the number vary?

Whippet
09-03-2014, 13:16
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.

18mfogwell
16-03-2014, 11:12
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.

Is there one numbers that is always associated with x or y?

Whippet
16-03-2014, 11:22
Is there one numbers that is always associated with x or y?

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.