FRC Joystick throttle problems

My team is using the throttle on the Attack 3 joystick for our kicker speed control, but for some reason it’s only returning -1, 0, or 1. Never anything else, despite being an analog input. Anyone else have this problem?
We’re passing it to a Victor (also, does anyone know the values a victor takes in? I can’t find them anywhere) after a bit of math to convert it.

I believe Victors work the same as jaguars, a value between -1 and 1. Are you looking at the output directly from the joystick? The problem could be in your conversion code

Do they now. My mentor was under the impression is was 0 - 255. That would explain some of our problems. Can you/anyone confirm that? I don’t have any hardware to actually test on right now :frowning:

By the way, we’re switching from LabVIEW to C++ for nationals, so it’s kind of… urgent that we figure all this out.

Both the Victor and Jaguar class implement the same MotorController interface which defines the use of the Set function, so I’d assume they take the same inputs (and I’m 100% sure it’s -1 to 1 on jags)

The 0-255 confusion is probably from the IFI system. I’ve never used it personally, but apparantly that is how the pwms on that board were controlled (no floating point capabilities on IFI)

Confirmed. The Joystick::GetThrottle() function also returns a float from -1 to +1.

And yes, it used to be 0 to 255 on the IFI control system.

Refer to the help docs that come with WindRiver (I believe it’s C:\WindRiver\docs\extensions\something). The return types and such are all in there.

Sounds like you are storing the joystick axis data in an integer variable. Make sure you store it in a float or a double.

TRY THIS:

if (ThirdStick->GetRawButton(3))
{
{ Variable->Set( ( ( ThirdStick->GetThrottle() / 2 ) - 0.5 ) ) ; } ;
};

it works well with our ball magnet