|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectioio.lib.impl.AbstractResource
ioio.lib.impl.AbstractPin
ioio.lib.impl.AnalogInputImpl
public class AnalogInputImpl
Method Summary | |
---|---|
void |
close()
|
void |
disconnected()
|
float |
getReference()
Gets the maximum value against which AnalogInput.read() values are scaled. |
float |
getVoltage()
Gets the analog input reading, as an absolute voltage in Volt units. |
float |
read()
Gets the analog input reading, as a scaled real value between 0 and 1. |
void |
setValue(int value)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public float getVoltage() throws java.lang.InterruptedException, ConnectionLostException
AnalogInput
It typically takes a few milliseconds between when the instance is created and until the first value can be read. In this case, the method may block shortly. If this is a problem, the calling thread can be interrupted.
If a scaled value is desired, consider using AnalogInput.read()
.
getVoltage
in interface AnalogInput
java.lang.InterruptedException
- The calling thread has been interrupted.
ConnectionLostException
- The connection with the IOIO is lost.AnalogInput.read()
public float getReference()
AnalogInput
AnalogInput.read()
values are scaled.
getReference
in interface AnalogInput
public void setValue(int value)
public float read() throws java.lang.InterruptedException, ConnectionLostException
AnalogInput
It typically takes a few milliseconds between when the instance is created and until the first value can be read. In this case, the method may block shortly. If this is a problem, the calling thread can be interrupted.
If an absolute value is desired, consider using AnalogInput.getVoltage()
.
read
in interface AnalogInput
java.lang.InterruptedException
- The calling thread has been interrupted.
ConnectionLostException
- The connection with the IOIO is lost.AnalogInput.getVoltage()
public void disconnected()
disconnected
in class AbstractResource
public void close()
close
in interface Closeable
close
in class AbstractPin
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |