View Single Post
  #4   Spotlight this post!  
Unread 12-02-2016, 21:40
MultipleMono's Avatar
MultipleMono MultipleMono is offline
Programmer & IT Guy
FRC #3128 (Aluminum Narwhals)
Team Role: Programmer
 
Join Date: Apr 2015
Rookie Year: 2013
Location: San Diego
Posts: 7
MultipleMono is an unknown quantity at this point
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.