Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   POV/Top Switch Programming for Java (http://www.chiefdelphi.com/forums/showthread.php?t=143659)

koreamaniac101 11-02-2016 18:27

POV/Top Switch Programming for Java
 
So my team is trying to program the top switch for our intake wheels so that:
  • The Forward Button on the POV would shoot the ball out
  • The Backward Button on the POV would intake the ball

How do we even call the Top Switch? What method in the Joystick Class would I use???

cgmv123 11-02-2016 18:29

Re: POV/Top Switch Programming for Java
 
Joystick.getPOV()

xXhunter47Xx 11-02-2016 18:34

Re: POV/Top Switch Programming for Java
 
Forgive me if I make things more confusing, but;

Is the joystick you're using the Logitech 3D one? If it is I believe it is just a hat switch, similar to the xBox controller. I hope this helps some.

MultipleMono 12-02-2016 21:40

Re: POV/Top Switch Programming for Java
 
The weird thing about Joystick.getPOV() is that it returns not booleans but an angle, in 45 degree increments. For example, if the user was pressing up on the DPAD, it would return zero. If the bottom and left buttons are being pressed, it would return 135. If no buttons are pressed, it would return -1.

I actually just wrote a class today to handle this, though it might not be useful outside of our larger system.


All times are GMT -5. The time now is 20:24.

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