com.sentilla.platform.tmote
Class Adc<Q extends javax.measure.quantity.Quantity>
java.lang.Object
com.sentilla.platform.tmote.Action
com.sentilla.platform.tmote.Adc<Q>
- All Implemented Interfaces:
- MultipleSensor, Action, Sensor<Q>
- Direct Known Subclasses:
- AccelerationSensor, McuTemperature, McuVoltage, ParSensorDriver.ParSensor, TsrSensorDriver.TsrSensor, VoltageAdc
public abstract class Adc<Q extends javax.measure.quantity.Quantity>
- extends Action
- implements Sensor<Q>, MultipleSensor
Private: for Sentilla internal use only.
Constructor Summary |
protected |
Adc(byte adcport,
byte refvolt)
|
Method Summary |
abstract javax.measure.Measurable<Q> |
getResult()
Asynchronous interface to get the result of the last sensor read operation. |
double |
getVoltage()
|
javax.measure.Measurable<Q> |
read()
Read a new measurement and return the result. |
void |
readMultipleRaw(int[] buffer,
byte[] adcports)
Read new set of raw measurements and return the result. |
Sensor<Q> |
setRead()
Asynchronous interface to set up a read operation on a sensor. |
REFVOLT_1_5
public static final byte REFVOLT_1_5
- See Also:
- Constant Field Values
REFVOLT_2_5
public static final byte REFVOLT_2_5
- See Also:
- Constant Field Values
PORT_A0
public static final byte PORT_A0
- See Also:
- Constant Field Values
PORT_A1
public static final byte PORT_A1
- See Also:
- Constant Field Values
PORT_A2
public static final byte PORT_A2
- See Also:
- Constant Field Values
PORT_A3
public static final byte PORT_A3
- See Also:
- Constant Field Values
PORT_A4
public static final byte PORT_A4
- See Also:
- Constant Field Values
PORT_A5
public static final byte PORT_A5
- See Also:
- Constant Field Values
PORT_A6
public static final byte PORT_A6
- See Also:
- Constant Field Values
PORT_A7
public static final byte PORT_A7
- See Also:
- Constant Field Values
PORT_VEREFP
public static final byte PORT_VEREFP
- See Also:
- Constant Field Values
PORT_VREFM_DIV_VEREFM
public static final byte PORT_VREFM_DIV_VEREFM
- See Also:
- Constant Field Values
PORT_TEMPERATURE
public static final byte PORT_TEMPERATURE
- See Also:
- Constant Field Values
PORT_AVCC_DIV_2
public static final byte PORT_AVCC_DIV_2
- See Also:
- Constant Field Values
refvolt
protected byte refvolt
numPortsToRead
protected short numPortsToRead
adcports
protected byte[] adcports
voltages
protected int[] voltages
Adc
protected Adc(byte adcport,
byte refvolt)
getVoltage
public double getVoltage()
read
public javax.measure.Measurable<Q> read()
- Description copied from interface:
Sensor
- Read a new measurement and return the result.
After reading a sensor, be sure to read its value using
Measureable.doubleValue(unit)
, where unit
defines the resulting unit for the reading (such as SI.Celsius for a
temperature reading).
- Specified by:
read
in interface Sensor<Q extends javax.measure.quantity.Quantity>
- Returns:
- Sensor measurement of type Q.
readMultipleRaw
public void readMultipleRaw(int[] buffer,
byte[] adcports)
- Description copied from interface:
MultipleSensor
- Read new set of raw measurements and return the result.
- Specified by:
readMultipleRaw
in interface MultipleSensor
- Parameters:
buffer
- is the array of int receiving the returned raw values of
the ADC.adcports
- is the array of ports to read from
setRead
public Sensor<Q> setRead()
- Description copied from interface:
Sensor
- Asynchronous interface to set up a read operation on a sensor.
Use the
submit()
function to initiating the sensor reading.
- Specified by:
setRead
in interface Sensor<Q extends javax.measure.quantity.Quantity>
- Returns:
- The instance of Sensor that is set to read its sensor
getResult
public abstract javax.measure.Measurable<Q> getResult()
- Description copied from interface:
Sensor
- Asynchronous interface to get the result of the last sensor read operation.
- Specified by:
getResult
in interface Sensor<Q extends javax.measure.quantity.Quantity>
- Returns:
- Sensor measurement of type Q.
Copyright © 2007 Sentilla Corporation. All Rights Reserved.