SunSPOT API V6.0


com.sun.spot.sensorboard.peripheral
Class LIS3L02AQAccelerometer

java.lang.Object
  extended by com.sun.spot.resources.Resource
      extended by com.sun.spot.sensorboard.peripheral.Accelerometer3D
          extended by com.sun.spot.sensorboard.peripheral.LIS3L02AQAccelerometer
All Implemented Interfaces:
IResource, IAccelerometer3D, IMeasurementInfo, IMeasurementRange, ITransducer, IScalarInputThresholdListener

public class LIS3L02AQAccelerometer
extends Accelerometer3D
implements IMeasurementRange, IScalarInputThresholdListener

Class to implement an accelerometer on the demo sensor board and provide access to it via the IAccelerometer3D interface. Provides methods specific to this particular accelerometer.

The LIS3L02AQ accelerometer can measure accelerations using either a 2G or 6G scale.

The accelerometer reports a voltage to indicate the acceleration along each axis. To convert this voltage to G's requires subtracting the zero acceleration voltage and then dividing by a gain constant:

Acceleration in G's = (Voltage - zero offset) / gain

A standard zero offset and gain are used by default, but since the accelerometer in each SPOT can differ by up to 10% from the default it is best to calibrate each SPOT and save the offset and gain for each axis and scale. An application to calibrate the accelerometer is provided with the SPOT Demos.

Note: By default the maximum rate that the accelerometer can be read is ~58 Hz, i.e. reading all three axis every 17.1 milliseconds. For faster readings the ADT7411 must be set to use its fast conversion rate that will allow reading all three axis every 0.579 milliseconds (or 1667 Hz). Note that setting the ADT7411 to fast mode may cause readings of A0 to become inaccurate.

Author:
Ron Goldman

Field Summary
static String ACCELEROMETER_GAINS_PROPERTY
          Name of the property holding the calibrated gains for this accelerometer
static String ACCELEROMETER_REST_OFFSETS_PROPERTY
          Name of the property holding the measured rest offsets for this accelerometer
static String ACCELEROMETER_ZERO_OFFSETS_PROPERTY
          Name of the property holding the calibrated zero offsets for this accelerometer
protected  boolean isInSelfTest
           
protected  int[] scale
           
static int SCALE_2G
          Constant index for setting the accelerometer to use the 2G scale
static int SCALE_6G
          Constant index for setting the accelerometer to use the 6G scale
protected  int scaleIndex
           
 
Fields inherited from class com.sun.spot.sensorboard.peripheral.Accelerometer3D
supportsThresholdEvents
 
Fields inherited from interface com.sun.spot.sensorboard.peripheral.IAccelerometer3D
ABSOLUTE, ALL_AXES, RELATIVE, X_AXIS, Y_AXIS, Z_AXIS
 
Fields inherited from interface com.sun.spot.resources.transducers.IAccelerometer3D
ALL_AXES, X_AXIS, Y_AXIS, Z_AXIS
 
Constructor Summary
LIS3L02AQAccelerometer(IScalarInput xInput, IScalarInput yInput, IScalarInput zInput, IOutputPin selfTest, IOutputPin fullScale)
          Constructor for the accelerometer.
 
Method Summary
 void addILIS3L02AQAccelerometerThresholdListener(ILIS3L02AQAccelerometerThresholdListener who)
          Add an ILIS3L02AQAccelerometerThresholdListener to the list of callbacks.
 void addIMeasurementRangeListener(IMeasurementRangeListener who)
          Add an IMeasurementRangeListener to the list of callbacks.
protected  boolean areThresholdEventsEnabledAux(int axis)
          Return whether threshold events are enabled or not.
protected  void disableInterrupts()
           
protected  void enableInterrupts()
           
protected  void enableThresholdEventsAux(int axis, boolean enable)
          Enable or disable threshold events.
 double getAccelX()
          Read the current acceleration along the X axis.
 double getAccelY()
          Read the current acceleration along the Y axis.
 double getAccelZ()
          Read the current acceleration along the Z axis.
 double getAccuracy()
          Returns the accuracy of the sensor (in the current measurement range) as a percentage of reading (=data value).
 double getAccuracy(int index)
          Returns the Nth accuracy of the specified measurement range.
 String getCalibration()
          Returns the current calibration values for this sensor.
 int getCurrentRange()
          Returns the index of the current measurement range of the given sensor.
 int getCurrentScale()
          Deprecated. please use IMeasurementRange getCurrentRange() instead.
 String getDescription()
          This method returns a readable description of the sensor.
 double[][] getGains()
          Return the current array of gains used to convert from voltages to G's.
protected  double getHighThresholdAux(int axis, boolean relative)
          Return the current high threshold value.
 ILIS3L02AQAccelerometerThresholdListener[] getILIS3L02AQAccelerometerThresholdListeners()
          Return all of the ILIS3L02AQAccelerometerThresholdListener callbacks.
 IMeasurementRangeListener[] getIMeasurementRangeListeners()
          Return all of the IMeasurementRangeListener callbacks.
protected  double getLowThresholdAux(int axis, boolean relative)
          Return the current low threshold value.
 double getMaxSamplingRate()
          Return the maximum sampling rate per second for this sensor.
 double getMaxValue()
          Returns the current maximum value of the sensor (in the current measurement range).
 double getMaxValue(int index)
          Returns the Nth max value of the specified measurement range.
 double getMinValue()
          Returns the current minimum value of the sensor (in the current measurement range).
 double getMinValue(int index)
          Returns the Nth min value of the specified measurement range.
 int getNumberRanges()
          Returns the number of possible measurement ranges for this given sensor.
 int getRaw(int axis)
          Read the current acceleration along the indicated axis.
 int[] getRawAccelValues()
          Return all the current raaw values.
 int getRawX()
          Return the raw value in volts for the acceleration along the X axis.
 int getRawY()
          Return the raw value in volts for the acceleration along the Y axis.
 int getRawZ()
          Return the raw value in volts for the acceleration along the Z axis.
 double getRelativeAccelX()
          Deprecated.  
 double getRelativeAccelY()
          Deprecated.  
 double getRelativeAccelZ()
          Deprecated.  
 double getResolution()
          Returns the resolution of the range (in the current measurement range).
 double getResolution(int index)
          Returns the Nth resolution of the specified measurement range.
 double[][] getRestOffsets()
          Deprecated.  
 int[] getScales()
          Deprecated. please use IMeasurementRange getMaxValue(int) instead.
 double[][] getZeroOffsets()
          Return the current array of zero offsets used to convert from voltages to G's.
 boolean isInSelfTest()
          Test if the accelerometer is in self-test mode.
 void removeILIS3L02AQAccelerometerThresholdListener(ILIS3L02AQAccelerometerThresholdListener who)
          Remove an ILIS3L02AQAccelerometerThresholdListener from the list of callbacks.
 void removeIMeasurementRangeListener(IMeasurementRangeListener who)
          Remove an IMeasurementRangeListener from the list of callbacks.
 void reset()
          Resets the accelerometer (ensures that it is not in self-test and is not powered down) and sets it to the 2G scale.
 void saveCalibration()
          Save the gain, zero and offset calibration arrays out to the EDemoBoard flash.
 void scaleChanged(int scale)
          Deprecated. should never have been called by user code
 void selfTest(boolean setSelfTestMode)
          Put the accelerometer into/out of self-test mode.
 void setCalibration(String calibration)
          Sets the calibration values for this sensor.
 void setCurrentRange(int range)
          Sets the measurement range of the sensor.
 void setGains(double[][] gains)
          Set the gains used to convert from voltages to G's.
 void setRestOffsets()
          Deprecated.  
 void setRestOffsets(double[][] offs)
          Deprecated.  
 void setScale(int newScaleIndex)
          Deprecated. please use IMeasurementRange setCurrentRange() instead.
protected  void setScaleAux(int newScaleIndex)
          Set the scale for this accelerometer to use.
protected  void setThresholdsAux(int axis, double low, double high, boolean relative)
          Set the low and high threshold values for this accelerometer.
 void setZeroOffsets(double[][] offs)
          Set the zero offsets used to convert from voltages to G's.
 void thresholdChanged(IScalarInput in, int low, int high)
          Callback for when the scalar input thresholds are changed.
 void thresholdExceeded(IScalarInput in, int val)
          Callback for when the scalar input value goes above or below the specified thresholds.
 
Methods inherited from class com.sun.spot.sensorboard.peripheral.Accelerometer3D
addIAccelerometer3DThresholdListener, areThresholdEventsEnabled, copyCalibArray, createSensorEvent, enableThresholdEvents, getAccel, getAccel, getAccelValues, getCalibString, getHighThreshold, getIAccelerometer3DThresholdListeners, getLowThreshold, getRelativeAccel, getRelativeAccel, getTilt, getTiltX, getTiltY, getTiltZ, p2, parseCalibrationString, removeIAccelerometer3DThresholdListener, saveEventState, setCalibArray, setThresholds, supportsThresholdEvents
 
Methods inherited from class com.sun.spot.resources.Resource
addTag, getTags, getTagValue, hasTag, removeTag
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.sun.spot.resources.IResource
addTag, getTags, getTagValue, hasTag, removeTag
 
Methods inherited from interface com.sun.spot.resources.IResource
addTag, getTags, getTagValue, hasTag, removeTag
 

Field Detail

ACCELEROMETER_ZERO_OFFSETS_PROPERTY

public static final String ACCELEROMETER_ZERO_OFFSETS_PROPERTY
Name of the property holding the calibrated zero offsets for this accelerometer

See Also:
Constant Field Values

ACCELEROMETER_REST_OFFSETS_PROPERTY

public static final String ACCELEROMETER_REST_OFFSETS_PROPERTY
Name of the property holding the measured rest offsets for this accelerometer

See Also:
Constant Field Values

ACCELEROMETER_GAINS_PROPERTY

public static final String ACCELEROMETER_GAINS_PROPERTY
Name of the property holding the calibrated gains for this accelerometer

See Also:
Constant Field Values

SCALE_2G

public static final int SCALE_2G
Constant index for setting the accelerometer to use the 2G scale

See Also:
Constant Field Values

SCALE_6G

public static final int SCALE_6G
Constant index for setting the accelerometer to use the 6G scale

See Also:
Constant Field Values

isInSelfTest

protected boolean isInSelfTest

scaleIndex

protected int scaleIndex

scale

protected int[] scale
Constructor Detail

LIS3L02AQAccelerometer

public LIS3L02AQAccelerometer(IScalarInput xInput,
                              IScalarInput yInput,
                              IScalarInput zInput,
                              IOutputPin selfTest,
                              IOutputPin fullScale)
Constructor for the accelerometer. Called by the EDemoBoard class. SPOT applications should get a reference to the accelerometer by calling EDemoBoard.getAccelerometer().

Parameters:
xInput - a RangeInput that will be used to access values for the x axis
yInput - a RangeInput that will be used to access values for the y axis
zInput - a RangeInput that will be used to access values for the z axis
selfTest - a SingleBitOutput to be used for self-testing
fullScale - a SingleBitOutput to be used in switching between the 2G and 6G scales
Method Detail

saveCalibration

public void saveCalibration()
Save the gain, zero and offset calibration arrays out to the EDemoBoard flash. The array values are written in the format: "(x2G, y2G, z2G) (x6G, y6G, z6G)"


getGains

public double[][] getGains()
Return the current array of gains used to convert from voltages to G's. The array is indexed by the accelerometer scale and by the 3 axes.

Returns:
the array[scale][axis] of gains: A = (V - Z) / G

getZeroOffsets

public double[][] getZeroOffsets()
Return the current array of zero offsets used to convert from voltages to G's. The array is indexed by the accelerometer scale and by the 3 axes.

Returns:
the array[scale][axis] of zero offsets: A = (V - Z) / G

getRestOffsets

public double[][] getRestOffsets()
Deprecated. 

Return the current array of rest offsets used to convert from voltages to relative G's. The array is indexed by the accelerometer scale and by the 3 axes.

Returns:
the array[scale][axis] of gains: relative A = (V - R) / G

setGains

public void setGains(double[][] gains)
Set the gains used to convert from voltages to G's. The array is indexed by the accelerometer scale and by the 3 axes.

Parameters:
gains - the array[scale][axis] of gains: A = (V - Z) / G

setZeroOffsets

public void setZeroOffsets(double[][] offs)
Set the zero offsets used to convert from voltages to G's. The array is indexed by the accelerometer scale and by the 3 axes.

Parameters:
offs - the array[scale][axis] of zero offsets: A = (V - Z) / G

setRestOffsets

public void setRestOffsets(double[][] offs)
Deprecated. 

Set the rest offsets used to convert from voltages to G's. The array is indexed by the accelerometer scale and by the 3 axes.

Parameters:
offs - the array[scale][axis] of rest offsets: relative A = (V - R) / G

reset

public void reset()
Resets the accelerometer (ensures that it is not in self-test and is not powered down) and sets it to the 2G scale.


getRawX

public int getRawX()
            throws IOException
Return the raw value in volts for the acceleration along the X axis.

Returns:
the current raw voltage for the X axis accelerometer sensor
Throws:
IOException

getRawY

public int getRawY()
            throws IOException
Return the raw value in volts for the acceleration along the Y axis.

Returns:
the current raw voltage for the Y axis accelerometer sensor
Throws:
IOException

getRawZ

public int getRawZ()
            throws IOException
Return the raw value in volts for the acceleration along the Z axis.

Returns:
the current raw voltage for the Z axis accelerometer sensor
Throws:
IOException

getRawAccelValues

public int[] getRawAccelValues()
                        throws IOException
Return all the current raaw values.

Returns:
all current values as array [ Ax, Ay, Az ]
Throws:
IOException

getRaw

public int getRaw(int axis)
           throws IOException
Read the current acceleration along the indicated axis.

Parameters:
axis - which axis to return (ALL_AXES = total acceleration)
Returns:
the current raw voltage for the indicated axis
Throws:
IOException

getAccelX

public double getAccelX()
                 throws IOException
Read the current acceleration along the X axis.

Specified by:
getAccelX in interface IAccelerometer3D
Specified by:
getAccelX in class Accelerometer3D
Returns:
the current acceleration in G's along the X axis
Throws:
IOException

getAccelY

public double getAccelY()
                 throws IOException
Read the current acceleration along the Y axis.

Specified by:
getAccelY in interface IAccelerometer3D
Specified by:
getAccelY in class Accelerometer3D
Returns:
the current acceleration in G's along the Y axis
Throws:
IOException

getAccelZ

public double getAccelZ()
                 throws IOException
Read the current acceleration along the Z axis.

Specified by:
getAccelZ in interface IAccelerometer3D
Specified by:
getAccelZ in class Accelerometer3D
Returns:
the current acceleration in G's along the Z axis
Throws:
IOException

setRestOffsets

public void setRestOffsets()
                    throws IOException
Deprecated. 

Compute the current acceleration along each axis and save it. Take the average of 25 readings along each axis. Do this for both the 2G and 6G scales. This method takes about one second to complete. Use these values to later be able to compute the acceleration relative to the current acceleration.

Specified by:
setRestOffsets in class Accelerometer3D
Throws:
IOException

getRelativeAccelX

public double getRelativeAccelX()
                         throws IOException
Deprecated. 

Read the current relative acceleration along the X axis. This value is relative to the last call to setRestOffsets().

Specified by:
getRelativeAccelX in class Accelerometer3D
Returns:
the current relative acceleration in G's along the X axis
Throws:
IOException

getRelativeAccelY

public double getRelativeAccelY()
                         throws IOException
Deprecated. 

Read the current relative acceleration along the Y axis. This value is relative to the last call to setRestOffsets().

Specified by:
getRelativeAccelY in class Accelerometer3D
Returns:
the current relative acceleration in G's along the Y axis
Throws:
IOException

getRelativeAccelZ

public double getRelativeAccelZ()
                         throws IOException
Deprecated. 

Read the current relative acceleration along the Z axis. This value is relative to the last call to setRestOffsets().

Specified by:
getRelativeAccelZ in class Accelerometer3D
Returns:
the current relative acceleration in G's along the Z axis
Throws:
IOException

selfTest

public void selfTest(boolean setSelfTestMode)
Put the accelerometer into/out of self-test mode.

Parameters:
setSelfTestMode - if true the accelerometer is put into self-test mode; if false, the accelerometer is taken out of self-test mode.

isInSelfTest

public boolean isInSelfTest()
Test if the accelerometer is in self-test mode.

Returns:
true if the accelerometer is in self-test mode

getScales

public int[] getScales()
Deprecated. please use IMeasurementRange getMaxValue(int) instead.

Get the possible scales this accelerometer supports.

Returns:
the array of possible scales

setScale

public void setScale(int newScaleIndex)
              throws IOException
Deprecated. please use IMeasurementRange setCurrentRange() instead.

Set the scale for this accelerometer to use. The LIS3L02AQAccelerometer accelerometer can be set to either SCALE_2G or SCALE_6G. After changing the scale this method sleeps for 100 milliseconds to give the accelerometer time to settle.

Any threshold values that had been set are automatically converted to the new scale and limited to the available range of the new scale.

Parameters:
newScaleIndex - the scale to use specified as an offset into the array returned by getScales()
Throws:
IOException

getCurrentScale

public int getCurrentScale()
Deprecated. please use IMeasurementRange getCurrentRange() instead.

Return the index for the current scale being used by the accelerometer.

Returns:
the scale in use specified as an offset into the array returned by getScales()

setScaleAux

protected void setScaleAux(int newScaleIndex)
Set the scale for this accelerometer to use. The LIS3L02AQ accelerometer can be set to either SCALE_2G or SCALE_6G. After changing the scale this method sleeps for 100 milliseconds to give the accelerometer time to settle. Any threshold values that had been set are automatically converted to the new scale and limited to the available range of the new scale.

Parameters:
newScaleIndex - the scale to use specified as an offset into the array returned by getScales()

scaleChanged

public void scaleChanged(int scale)
Deprecated. should never have been called by user code

no longer used - Callback for when the accelerometer scale is changed.

Parameters:
scale - the new scale setting.

enableInterrupts

protected void enableInterrupts()

disableInterrupts

protected void disableInterrupts()

setThresholdsAux

protected void setThresholdsAux(int axis,
                                double low,
                                double high,
                                boolean relative)
Set the low and high threshold values for this accelerometer. Callbacks occur when the accelerometer reading of the specified axis falls below or equal to the low threshold value, or when it rises above or equal to the high threshold value.

Overrides:
setThresholdsAux in class Accelerometer3D
Parameters:
axis - which axis to set threshold values for.
low - the new low threshold value.
high - the new high threshold value.
relative - compute threshold relative to the current rest offset.

getLowThresholdAux

protected double getLowThresholdAux(int axis,
                                    boolean relative)
Return the current low threshold value.

Overrides:
getLowThresholdAux in class Accelerometer3D
Parameters:
axis - which axis to return Note: specifying ALL_AXES will throw an IllegalArgumentException.
relative - if true then threshold is relative to the current rest offset.
Returns:
the current low threshold value.

getHighThresholdAux

protected double getHighThresholdAux(int axis,
                                     boolean relative)
Return the current high threshold value.

Overrides:
getHighThresholdAux in class Accelerometer3D
Parameters:
axis - which axis to return Note: specifying ALL_AXES will throw an IllegalArgumentException.
relative - if true then threshold is relative to the current rest offset.
Returns:
the current high threshold value.

enableThresholdEventsAux

protected void enableThresholdEventsAux(int axis,
                                        boolean enable)
Enable or disable threshold events.

Overrides:
enableThresholdEventsAux in class Accelerometer3D
Parameters:
axis - which axis to enable
enable - if true then listeners will be notified if the scalar input reading goes above the high threshold or below the low threshold.

areThresholdEventsEnabledAux

protected boolean areThresholdEventsEnabledAux(int axis)
Return whether threshold events are enabled or not.

Overrides:
areThresholdEventsEnabledAux in class Accelerometer3D
Parameters:
axis - which axis to return Note: specifying ALL_AXES will return true only if all three axes are enabled.
Returns:
true if listeners will be notified if the scalar input reading goes above the high threshold or below the low threshold.

thresholdExceeded

public void thresholdExceeded(IScalarInput in,
                              int val)
Callback for when the scalar input value goes above or below the specified thresholds.

Specified by:
thresholdExceeded in interface IScalarInputThresholdListener
Parameters:
in - the IScalarInput that has crossed a threshold.
val - the current scalar input reading.

thresholdChanged

public void thresholdChanged(IScalarInput in,
                             int low,
                             int high)
Callback for when the scalar input thresholds are changed.

Specified by:
thresholdChanged in interface IScalarInputThresholdListener
Parameters:
in - the IScalarInput that had its threshold values changed.
low - the new scalar input low threshold value.
high - the new scalar input high threshold value.

getDescription

public String getDescription()
Description copied from interface: ITransducer
This method returns a readable description of the sensor. The description should tell the essentials of the sensor, including at least the sensor type (accelerometer, microphone, thermometer). The returned string MUST not be null or an empty string.

Specified by:
getDescription in interface ITransducer
Returns:
the description of the sensor

getMaxSamplingRate

public double getMaxSamplingRate()
Description copied from interface: ITransducer
Return the maximum sampling rate per second for this sensor.

Specified by:
getMaxSamplingRate in interface ITransducer
Returns:
the maximum sampling rate per second for this sensor or 0 if not applicable.

getMinValue

public double getMinValue()
Description copied from interface: IMeasurementInfo
Returns the current minimum value of the sensor (in the current measurement range).

Specified by:
getMinValue in interface IMeasurementInfo
Returns:
the min value of the sensor

getMaxValue

public double getMaxValue()
Description copied from interface: IMeasurementInfo
Returns the current maximum value of the sensor (in the current measurement range).

Specified by:
getMaxValue in interface IMeasurementInfo
Returns:
the max value of the sensor

getResolution

public double getResolution()
Description copied from interface: IMeasurementInfo
Returns the resolution of the range (in the current measurement range). The resolution is the minimum amount of change in the input of a sensor that can be detected as a change in the output. Resolution is a property of the transducer of a sensor but the input and output ranges and word length of the A/D converter usually set the limitations for the resolution of a digital sensor.

Specified by:
getResolution in interface IMeasurementInfo
Returns:
resolution of the sensor

getAccuracy

public double getAccuracy()
Description copied from interface: IMeasurementInfo
Returns the accuracy of the sensor (in the current measurement range) as a percentage of reading (=data value). Because this accuracy value describes the relative measurement error, greater values indicate a less accurate sensor. The accuracy value is within: 0 ≤ accuracy < 1

Specified by:
getAccuracy in interface IMeasurementInfo
Returns:
the accuracy of the sensor. If the accuracy is not known, a value of -1 is returned.

getNumberRanges

public int getNumberRanges()
Description copied from interface: IMeasurementRange
Returns the number of possible measurement ranges for this given sensor.

Specified by:
getNumberRanges in interface IMeasurementRange
Returns:
the number of possible measurement ranges for this given sensor.

getCurrentRange

public int getCurrentRange()
Description copied from interface: IMeasurementRange
Returns the index of the current measurement range of the given sensor.

Specified by:
getCurrentRange in interface IMeasurementRange
Returns:
the current measurement range of the given sensor.

setCurrentRange

public void setCurrentRange(int range)
Description copied from interface: IMeasurementRange
Sets the measurement range of the sensor.

Specified by:
setCurrentRange in interface IMeasurementRange
Parameters:
range - the index of the measurement range to be set.

getMinValue

public double getMinValue(int index)
Description copied from interface: IMeasurementRange
Returns the Nth min value of the specified measurement range.

Specified by:
getMinValue in interface IMeasurementRange
Returns:
the Nth min value of the specified measurement range

getMaxValue

public double getMaxValue(int index)
Description copied from interface: IMeasurementRange
Returns the Nth max value of the specified measurement range.

Specified by:
getMaxValue in interface IMeasurementRange
Returns:
the Nth max value of the specified measurement range

getResolution

public double getResolution(int index)
Description copied from interface: IMeasurementRange
Returns the Nth resolution of the specified measurement range.

Specified by:
getResolution in interface IMeasurementRange
Returns:
the Nth resolution of the specified measurement range

getAccuracy

public double getAccuracy(int index)
Description copied from interface: IMeasurementRange
Returns the Nth accuracy of the specified measurement range.

Specified by:
getAccuracy in interface IMeasurementRange
Returns:
the Nth accuracy of the specified measurement range

addIMeasurementRangeListener

public void addIMeasurementRangeListener(IMeasurementRangeListener who)
Add an IMeasurementRangeListener to the list of callbacks.

Specified by:
addIMeasurementRangeListener in interface IMeasurementRange
Parameters:
who - the IMeasurementRangeListener to add

removeIMeasurementRangeListener

public void removeIMeasurementRangeListener(IMeasurementRangeListener who)
Remove an IMeasurementRangeListener from the list of callbacks.

Specified by:
removeIMeasurementRangeListener in interface IMeasurementRange
Parameters:
who - the IMeasurementRangeListener to remove

getIMeasurementRangeListeners

public IMeasurementRangeListener[] getIMeasurementRangeListeners()
Return all of the IMeasurementRangeListener callbacks.

Specified by:
getIMeasurementRangeListeners in interface IMeasurementRange
Returns:
an array of the IMeasurementRangeListener callbacks

addILIS3L02AQAccelerometerThresholdListener

public void addILIS3L02AQAccelerometerThresholdListener(ILIS3L02AQAccelerometerThresholdListener who)
Add an ILIS3L02AQAccelerometerThresholdListener to the list of callbacks.

Parameters:
who - the ILIS3L02AQAccelerometerThresholdListener to add

removeILIS3L02AQAccelerometerThresholdListener

public void removeILIS3L02AQAccelerometerThresholdListener(ILIS3L02AQAccelerometerThresholdListener who)
Remove an ILIS3L02AQAccelerometerThresholdListener from the list of callbacks.

Parameters:
who - the ILIS3L02AQAccelerometerThresholdListener to remove

getILIS3L02AQAccelerometerThresholdListeners

public ILIS3L02AQAccelerometerThresholdListener[] getILIS3L02AQAccelerometerThresholdListeners()
Return all of the ILIS3L02AQAccelerometerThresholdListener callbacks.

Returns:
an array of the ILIS3L02AQAccelerometerThresholdListener callbacks

getCalibration

public String getCalibration()
Returns the current calibration values for this sensor.

Returns:
the current calibration values for this sensor.

setCalibration

public void setCalibration(String calibration)
Sets the calibration values for this sensor.

Parameters:
calibration - calibration values to be set.
Throws:
IllegalArgumentException - - if the given string cannot be parsed

SunSPOT API V6.0


Copyright © 2006-2010 Oracle. All Rights Reserved.