Go to Post The difference between a Tinkerer and an Engineer is that the Engineer will be able to tell you the results before you start. - DonRotolo [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 26-09-2013, 20:25
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 336
fovea1959 will become famous soon enough
InternalButton based on axis inputs

I remember seeing a team's nice InternalButton implementation that would take a GenericHID (or Joystick?), an exis specification, and a threshold, and produce a couple of InternalButton objects ; the idea being that commands could be trigger off the joystick (or DPAD) position.

I thought I had it safely squirreled away, but it's not coming up.

Has anyone else seen this? Don't want to write something that's already out in the wild....
Reply With Quote
  #2   Spotlight this post!  
Unread 26-09-2013, 23:05
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,590
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: InternalButton based on axis inputs

Here it is in C++ http://www.chiefdelphi.com/forums/sh...29&postcount=6
Reply With Quote
  #3   Spotlight this post!  
Unread 27-09-2013, 10:31
BigJ BigJ is online now
Registered User
AKA: Josh P.
FRC #1675 (Ultimate Protection Squad)
Team Role: Engineer
 
Join Date: Jan 2007
Rookie Year: 2007
Location: Milwaukee, WI
Posts: 947
BigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond reputeBigJ has a reputation beyond repute
Re: InternalButton based on axis inputs

Here's a not-quite-generic version in Java, but could easily be modified to be generic to your needs:

https://github.com/frc1675/frc1675-2...PadButton.java

edit: looking at it again, this is such a short class that "modifying it to your needs" is basically rewriting the class, haha. I also looked at the javadoc for InternalButton, and we didn't use this as one, but I'm pretty sure it could just extend InternalButton instead if you wanted access to setPressed().

Last edited by BigJ : 27-09-2013 at 10:34.
Reply With Quote
  #4   Spotlight this post!  
Unread 28-09-2013, 16:16
fovea1959's Avatar
fovea1959 fovea1959 is offline
Herder of programmers
AKA: Doug Wegscheid
FRC #3620 (The Average Joes)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2011
Location: St Joseph
Posts: 336
fovea1959 will become famous soon enough
Re: InternalButton based on axis inputs

Thanks!

and the third answer from team 2168,very similar to both the above.

https://gist.github.com/jcorcoran/5743806

comments are not quite right around the description of the constructor, but it's also nice to use.
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 12:42.

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