Trying to set up an Xbox Controller to gradually adjust speeds when using the triggers. I got it working fine with a Logitech joystick because I had the full range of the axis. However, with the Xbox controllers, I only have one direction on the axis. So wondering how I can make trigger the positive direction and the other the negative direction. Is it as simple as copying my code, switching the number for the axis, and including a negative in front of my x^3?
Lets first fully clarify what you want to do:
- Is the code above what you were doing?
- Do you want to be able to run the intake both forwards and backwards?
- Do you want both bottom and top to run at the same speed?
- Do you want the left trigger to do something different than the right trigger?
This is what I was running on the Logitech joystick. This was set up so the motors ran an the same speed, they ran in opposite directions because I have that flipped in the begin VI. We were using the slider on the bottom of the joystick. We want to switch it to an Xbox controller where the left trigger gradually spins the motors in one direction and the right trigger gradually spins the motors in the other direction.
The easiest way to do this is to take the left trigger minus the right trigger. This has the downside of doing something funny if you hold down both triggers but I would suggest just not doing that.
I recommend code like this that reapplies the negative sign (conditionally on it being <0 before) after cubing the value.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.