Go to Post I say we all stop flaming and pointing out what went wrong or what bad calls were made and start pointing out how much fun we all have at the regionals and what FIRST actually has done for us. - burkechrs1 [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 29-01-2011, 12:17
PeteG PeteG is offline
Registered User
FRC #2084 (Robots by the C)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: The North Shore of Massachusetts
Posts: 5
PeteG will become famous soon enough
Question Potentiometers in Java

Our team is trying to find a way to measure the position of our arm using a potentiometer. We're using Java this year and we can't find any classes that are for potentiometers.

Does anyone know the best way that we could program a potentiometer in Java to give us its position?
Reply With Quote
  #2   Spotlight this post!  
Unread 29-01-2011, 13:04
mwtidd's Avatar
mwtidd mwtidd is offline
Registered User
AKA: mike
FRC #0319 (Big Bad Bob)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2003
Location: Boston, MA
Posts: 714
mwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond reputemwtidd has a reputation beyond repute
Re: Potentiometers in Java

Quote:
Originally Posted by PeteG View Post
Our team is trying to find a way to measure the position of our arm using a potentiometer. We're using Java this year and we can't find any classes that are for potentiometers.

Does anyone know the best way that we could program a potentiometer in Java to give us its position?
I think you can use analog channel
__________________
"Never let your schooling interfere with your education" -Mark Twain
Reply With Quote
  #3   Spotlight this post!  
Unread 29-01-2011, 17:57
PeteG PeteG is offline
Registered User
FRC #2084 (Robots by the C)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: The North Shore of Massachusetts
Posts: 5
PeteG will become famous soon enough
Re: Potentiometers in Java

Quote:
Originally Posted by lineskier View Post
I think you can use analog channel
Awesome, thanks, I assume you mean the AnalogChannel class (there are a few others like AnalogModule, AnalogTrigger, etc.).

Would we use getVoltage() or getValue()? It might be getVoltage() since (I think) potentiometers just limit the voltage when the knob is turned. I've never used potentiometers before, though.
Reply With Quote
  #4   Spotlight this post!  
Unread 29-01-2011, 18:53
sjspry sjspry is offline
Registered User
FRC #1984
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Kansas
Posts: 125
sjspry has a spectacular aura aboutsjspry has a spectacular aura aboutsjspry has a spectacular aura about
Re: Potentiometers in Java

It shouldn't matter, you will just obtain different values. getValue will be something more akin to a "percent" (but in a range of integral values), while getVoltage will be un-scaled to be a voltage.

IIRC, getValue will give you more resolution, but overall it won't matter.
Reply With Quote
  #5   Spotlight this post!  
Unread 29-01-2011, 21:06
PeteG PeteG is offline
Registered User
FRC #2084 (Robots by the C)
Team Role: Programmer
 
Join Date: Jan 2011
Rookie Year: 2010
Location: The North Shore of Massachusetts
Posts: 5
PeteG will become famous soon enough
Re: Potentiometers in Java

OK, we'll just pick one and go with it in the code. Thanks for your help.
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 10:39.

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