if m_axisMotor is a pointer to the motor and m_stick is a pointer to the joystick. Isn’t this suppose to get the Y position of the right button of the Joystick and setting the motor to have that value?
In C++, if the two are pointers, it should be m_axisMotor->Set(m_stick->GetRawAxis(4));. Which axis this maps to on the physical joystick depends on the joystick.
Like Peter said, if they both are pointers then you should replace the . (dots) with ->
Other than that, the code should work fine, except I believe axis 4 is the X position of the right analog stick. If 4 does not work, then try 3 or 5. To know for sure you can just the joystick tab of the driver station.
According to the docs I have, for an xbox-style controller 4 is the X axis (side-to-side) and 5 is the Y axis (forward-and-back). Also, all the xbox-style controllers we’ve worked with send a -1 when pushed all the way forward and a +1 when pulled all the way back.
and also just one more thing. Can anyone give an example of using the PWMSpeedController to control the other speed controller that we bought separately.
So I don’t know but for some reason it’s saying that the raw axis could not be found I tried doing both 4 and 5 to get the raw axis but it is not working is there a specific way that it is suppose to be. because the GetX and GetY works but not the GetRawAxis();
Do you have multiple joysticks plugged in to the driver station? What does the joysticks tab in the DS show? It could be that you are trying to access an axis on the wrong joysticks because the IDs are wrong.
no It was the only joystick. But it’s OK I couldn’t get the value that I would have Ideally wanted but I used GetZ which is kinda the same value it just instead of the Y it is giving the x value. but finding out what the problem is will definitely help with next year.