Go to Post When you do something great, it just feels good. - tiffany34990 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 11-02-2016, 18:27
koreamaniac101's Avatar
koreamaniac101 koreamaniac101 is offline
Founder and Team Leader
AKA: Soohan Kim
FRC #5938 (Razor Steel Robotics 4-H Club)
Team Role: Leadership
 
Join Date: Feb 2015
Rookie Year: 2016
Location: Dover, Delaware
Posts: 20
koreamaniac101 is an unknown quantity at this point
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???
  #2   Spotlight this post!  
Unread 11-02-2016, 18:29
cgmv123's Avatar
cgmv123 cgmv123 is offline
FRC RI/FLL Field Manager
AKA: Max Vrany
FRC #1306 (BadgerBOTS)
Team Role: College Student
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Madison, WI
Posts: 2,073
cgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond reputecgmv123 has a reputation beyond repute
Re: POV/Top Switch Programming for Java

Joystick.getPOV()
__________________
BadgerBOTS Robotics|@team1306|Facebook: BadgerBOTS
2016 FIRST Championship Tesla Division | 2016 Wisconsin Regional Engineering Inspiration Award

2015 FIRST Championship Carson Division | 2015 Wisconsin Regional Chairman's Award

2013 FIRST Championship Curie Division | 2013 Wisconsin Regional Chairman's Award

2012 FIRST Championship Archimedes Division | 2012 Wisconsin Regional Engineering Inspiration Award, Woodie Flowers Finalist Award (Lead Mentor Ben Senson)

  #3   Spotlight this post!  
Unread 11-02-2016, 18:34
xXhunter47Xx's Avatar
xXhunter47Xx xXhunter47Xx is offline
Lord of Lazy
AKA: Austin $wagmaster1337
FRC #4738 (Patribots)
Team Role: College Student
 
Join Date: Jan 2014
Rookie Year: 2013
Location: San Diego
Posts: 305
xXhunter47Xx will become famous soon enough
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.
__________________
College sux yo
  #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.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 03:37.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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