Go to Post Some advice I wish I had as a college freshman: If you don't understand it, or are struggling to keep up, ask for help. - DonRotolo [more]
Home
Go Back   Chief Delphi > FIRST > General Forum
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 30-11-2016, 10:33
whitetail's Avatar
whitetail whitetail is offline
Registered User
FRC #5407 (Wolf Pack)
Team Role: Operator
 
Join Date: Dec 2014
Rookie Year: 2014
Location: Philadelphia
Posts: 48
whitetail is an unknown quantity at this point
Using POV in Java

I am relatively new to programming and still have a lot to learn. I found some code on an old post on Chief Delphi and I added a class and added that in but it says: public class POV implements IControl. I am wondering what it means by implementing IControl and what is IControl and how to I implement it in my code. All help is gratefully appreciated
__________________
FRC Team 5407 -Driver, Programmer and Head Control Systems Engineer
2015 MAR Championship Rookie All Star Award
2015 MAR Hatboro-Horsham District Rookie All Star Award
2015 MAR Hatboro-Horsham District event Winner(Thanks 2590, 2607)
Reply With Quote
  #2   Spotlight this post!  
Unread 30-11-2016, 10:42
orangelight's Avatar
orangelight orangelight is offline
Registered User
AKA: Alex
FRC #0548 (Robostangs)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2014
Location: Northville
Posts: 166
orangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to beholdorangelight is a splendid one to behold
Re: Using POV in Java

Can you link the CD post?
__________________


Reply With Quote
  #3   Spotlight this post!  
Unread 30-11-2016, 10:46
nickbrickmaster's Avatar
nickbrickmaster nickbrickmaster is offline
Not Allowed Near Power Tools
AKA: Nick Schatz
FRC #3184 (Blaze Robotics)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Eagan MN
Posts: 147
nickbrickmaster is an unknown quantity at this point
Re: Using POV in Java

What exactly are you trying to do?

IControl is an interface, I assume for controllers. I've never seen it before, and unless you are implementing some custom control interface, I don't think you need it.

Just googling it, I found a Github repo from 3128 with class POV implementing IControl. IControl is a file in that same repo, and should be distributed along with POV.

I think you're putting the cart before the horse, if it were. There is probably a better way to do what you're trying to do.
__________________
I have approximate knowledge of many things.

FRC 3184: 2014-, FTC 10648: 2015-
Reply With Quote
  #4   Spotlight this post!  
Unread 30-11-2016, 10:49
whitetail's Avatar
whitetail whitetail is offline
Registered User
FRC #5407 (Wolf Pack)
Team Role: Operator
 
Join Date: Dec 2014
Rookie Year: 2014
Location: Philadelphia
Posts: 48
whitetail is an unknown quantity at this point
Re: Using POV in Java

https://www.chiefdelphi.com/forums/s...&highlight=pov
__________________
FRC Team 5407 -Driver, Programmer and Head Control Systems Engineer
2015 MAR Championship Rookie All Star Award
2015 MAR Hatboro-Horsham District Rookie All Star Award
2015 MAR Hatboro-Horsham District event Winner(Thanks 2590, 2607)
Reply With Quote
  #5   Spotlight this post!  
Unread 30-11-2016, 11:06
nickbrickmaster's Avatar
nickbrickmaster nickbrickmaster is offline
Not Allowed Near Power Tools
AKA: Nick Schatz
FRC #3184 (Blaze Robotics)
Team Role: Leadership
 
Join Date: Jan 2015
Rookie Year: 2014
Location: Eagan MN
Posts: 147
nickbrickmaster is an unknown quantity at this point
Re: Using POV in Java

Yeah, just use the getPOV() method of your joystick object. It's not hard to check this angle against constants to determine which direction is pressed.
__________________
I have approximate knowledge of many things.

FRC 3184: 2014-, FTC 10648: 2015-
Reply With Quote
  #6   Spotlight this post!  
Unread 30-11-2016, 12:57
gerthworm's Avatar
gerthworm gerthworm is offline
Making the 1's and 0's
FRC #1736 (Robot Casserole)
Team Role: Mentor
 
Join Date: Jan 2015
Rookie Year: 2015
Location: Peoria, IL
Posts: 56
gerthworm has a spectacular aura aboutgerthworm has a spectacular aura about
Re: Using POV in Java

Java background - The "implements" keyword indicates that the class named POV has a required set of interface functions defined by the interface IControl. IControl effectively puts requirements on what sorts of functionality the POV class must provide. http://stackoverflow.com/questions/4...-do-on-a-class has a pretty good example.

As already mentioned, Joystick.getPOV() is probably the right answer, making the above statement relevant only for your edification.

As an example somewhat related to what you were doing, here's code our students wrote last year specific to an XBOX 360 controller, where we determine which direction(s) the POV hat is pushed based on angle criteria:
https://github.com/RobotCasserole173...ontroller.java

Last edited by gerthworm : 30-11-2016 at 13:24.
Reply With Quote
Reply


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 20:24.

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