I'm using an Xbox controller, which are notorious for not returning to center properly. I want to use a threshold of +- .1 (on a scale of -1 to 1).
I assume it would be something like:
Code:
if ((joystick < .1) && (joystick > -.1)) {
return 0;
}
but I'm new to Java and have no idea where I would put the statement.
Also: I'm planning on using one thumbstick to turn, and the right trigger as throttle, but I'm not sure how you would accomplish that and most tutorials are either for tank drive or in languages other than Java.
Thanks!