View Single Post
  #3   Spotlight this post!  
Unread 17-02-2015, 16:30
RobotMonkey RobotMonkey is offline
Registered User
FRC #1413
 
Join Date: Jan 2015
Location: United States
Posts: 7
RobotMonkey is an unknown quantity at this point
Re: Point of View from Controller

"Joystick get" outputs three arrays. Axes (doubles), buttons (booleans), and hat switches (ints). Your POV hat is the the first value in the hat switch array. It has a value of -1 if nothing is pressed. Otherwise, it will return the angle in 45 degree increments. So up is 0, up/right is 45, right is 90, down/right is 135, down is 180, down/left is 225, left is 270, and left/up is 315.

Personally, I am using the pov hat to control our camera gimbal. The case shown, 180, is when the dpad is pressed down. In that case, I tilt the camera down by a degree. The max is there to keep it from trying to decrease the angle below 1, which causes the servo to freak out and start skipping backwards.

Last edited by RobotMonkey : 17-02-2015 at 17:19.
Reply With Quote