|
Sun SPOT API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sun.spot.sensorboard.peripheral.LIS3L02AQAccelerometer
public class LIS3L02AQAccelerometer
Class to implement an accelerometer on the demo sensor board and provide access to it via the Accelerometer3D interface.
| Constructor Summary | |
|---|---|
LIS3L02AQAccelerometer(IScalarInput xInput,
IScalarInput yInput,
IScalarInput zInput,
IOutputPin selfTest,
IOutputPin fullScale)
Constructor for the accelerometer |
|
| Method Summary | |
|---|---|
int |
getCurrentRange()
|
int[] |
getRanges()
|
IScalarInput |
getXAxis()
Returns a RangeInput giving access to the accelerometer's reading for the x axis |
IScalarInput |
getYAxis()
Returns a RangeInput giving access to the accelerometer's reading for the y axis |
IScalarInput |
getZAxis()
Returns a RangeInput giving access to the accelerometer's reading for the z axis |
boolean |
isInSelfTest()
|
String |
name()
An identifying name for the driver (e.g. |
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 |
selfTest(boolean setSelfTestMode)
|
void |
setRange(int rangeIndex)
Set the current range of this device to the range corresponding to getRanges()[rangeIndex] |
void |
setUp()
Activate or reactivate the driver (after a deep sleep or when another driver refused to deep sleep). |
boolean |
tearDown()
Deactivate the driver (usually in preparation for deep sleep). |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LIS3L02AQAccelerometer(IScalarInput xInput,
IScalarInput yInput,
IScalarInput zInput,
IOutputPin selfTest,
IOutputPin fullScale)
xInput - a RangeInput that will be used to access values for the x axisyInput - a RangeInput that will be used to access values for the y axiszInput - a RangeInput that will be used to access values for the z axisselfTest - a SingleBitOutput to be used for self-testingpowerDown - a SingleBitOutput to be used to put the accelerometer into power-down modefullScale - a SingleBitOutput to be used in switching between the 2G and 6G scales| Method Detail |
|---|
public void reset()
public String name()
IDriver
name in interface IDriverpublic void setUp()
IDriver
setUp in interface IDriverpublic boolean tearDown()
IDriver
tearDown in interface IDriverpublic IScalarInput getXAxis()
getXAxis in interface IAccelerometer3DIAccelerometer3D.getXAxis()public IScalarInput getYAxis()
getYAxis in interface IAccelerometer3DIAccelerometer3D.getYAxis()public IScalarInput getZAxis()
getZAxis in interface IAccelerometer3DIAccelerometer3D.getZAxis()public void selfTest(boolean setSelfTestMode)
setSelfTestMode - if true the accelerometer is
put into self-test mode; if false, the accelerometer is taken out of self-test mode.public boolean isInSelfTest()
public int[] getRanges()
getRanges in interface IAccelerometer3Dpublic void setRange(int rangeIndex)
IAccelerometer3D
setRange in interface IAccelerometer3DrangeIndex - index into getRanges() of the required rangepublic int getCurrentRange()
getCurrentRange in interface IAccelerometer3D
|
Sun SPOT API |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||