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

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!

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

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.

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

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?

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?

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.