|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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? |
|
#2
|
||||
|
||||
|
Re: Potentiometers in Java
Quote:
|
|
#3
|
|||
|
|||
|
Re: Potentiometers in Java
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. |
|
#4
|
|||
|
|||
|
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. |
|
#5
|
|||
|
|||
|
Re: Potentiometers in Java
OK, we'll just pick one and go with it in the code. Thanks for your help.
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|