Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Java (http://www.chiefdelphi.com/forums/forumdisplay.php?f=184)
-   -   Potentiometers in Java (http://www.chiefdelphi.com/forums/showthread.php?t=90403)

PeteG 29-01-2011 12:17

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?

mwtidd 29-01-2011 13:04

Re: Potentiometers in Java
 
Quote:

Originally Posted by PeteG (Post 1011037)
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

PeteG 29-01-2011 17:57

Re: Potentiometers in Java
 
Quote:

Originally Posted by lineskier (Post 1011052)
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.

sjspry 29-01-2011 18:53

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.

PeteG 29-01-2011 21:06

Re: Potentiometers in Java
 
OK, we'll just pick one and go with it in the code. Thanks for your help.


All times are GMT -5. The time now is 10:39.

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