Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Xbox controller help please (http://www.chiefdelphi.com/forums/showthread.php?t=130570)

1024Programming 09-17-2014 06:48 PM

Xbox controller help please
 
So we've been trying to get rid of Digital IO Buttons and use the Xbox controller for our operator. I've found from searching that the Xbox controller can be called as a Joystick, and the A, B, X, and Y buttons, Right Stick Button, Left Stick Button, and the Bumpers can be called as JoystickButtons. Also the two sticks, the triggers, and the D-Pad are six axes of the Joystick, however, the D-Pad is extremely glitchy. I'm trying to use the triggers to activate a cylinder in the OI, where all of the other buttons activate commands. Here's the code from in the OI.java

if(xBox.getRawAxis(3)>0.5){
Robot.catcher.clamp=true;
}
else if(xBox.getRawAxis(3)<0.5){
Robot.catcher.clamp=false;
}

Does anyone know why this won't fire the cylinder? (I don't have the code with me so if the cylinder code isn't right here, sorry, I know it's right in the actual code)

1024Programming 09-17-2014 09:34 PM

Never mind. We were doing it right. We just had the code in the wrong location. ...feeling a little silly now. :)


All times are GMT -5. The time now is 09:00 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi