|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sentilla.platform.tmote.Action
com.sentilla.platform.tmote.Adc<javax.measure.quantity.Acceleration>
com.sentilla.platform.tmote.AccelerationSensor
public class AccelerationSensor
Sensor class for reading measurements from the JCreate accelerometer. Each instance of this class can read a single axis of the accelerometer. Measurements are returned as an Acceleration quantity in meters/s^2.
Adc
,
Sensor
Field Summary | |
---|---|
static byte |
G_RANGE_1_5
|
static byte |
G_RANGE_2
|
static byte |
G_RANGE_4
|
static byte |
G_RANGE_6
|
static byte |
X_AXIS
|
static byte |
Y_AXIS
|
static byte |
Z_AXIS
|
Fields inherited from class com.sentilla.platform.tmote.Adc |
---|
adcports, numPortsToRead, PORT_A0, PORT_A1, PORT_A2, PORT_A3, PORT_A4, PORT_A5, PORT_A6, PORT_A7, PORT_AVCC_DIV_2, PORT_TEMPERATURE, PORT_VEREFP, PORT_VREFM_DIV_VEREFM, refvolt, REFVOLT_1_5, REFVOLT_2_5, voltages |
Fields inherited from class com.sentilla.platform.tmote.Action |
---|
actionAuto, actionId, actionState, isolateOwner |
Fields inherited from interface com.sentilla.system.Action |
---|
DONE, ERROR, IDLE, PENDING |
Constructor Summary | |
---|---|
AccelerationSensor(byte adcport,
byte gRange)
Constructor takes two arguments, the pin port associated with an accelerometer axis and the acceleration range. |
Method Summary | |
---|---|
byte |
getGRange()
Returns the current sensitivity setting. |
javax.measure.Measurable<javax.measure.quantity.Acceleration> |
getResult()
Returns the Measurable quantity that the sensor read. |
float |
getVref()
Returns the current reference voltage value as a float. |
void |
setAxis(byte b)
Set the axis that this AccelerationSensor object reads. |
void |
setGRange(byte b)
Set the sensitivity level, called G-range, for the accelerometer. |
static void |
setRefVoltage()
Sets the reference voltage this sensor uses to calibrate the acceleration settings. |
void |
setSleep(boolean sleep)
Sets the accelerometer sleep mode on or off. |
Methods inherited from class com.sentilla.platform.tmote.Adc |
---|
getVoltage, read, readMultipleRaw, setRead |
Methods inherited from class com.sentilla.platform.tmote.Action |
---|
block, block, cancel, getActionState, initAction, isDone, lookup, submit |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.sentilla.system.Action |
---|
block, block, cancel, getActionState, isDone, submit |
Field Detail |
---|
public static final byte G_RANGE_1_5
public static final byte G_RANGE_2
public static final byte G_RANGE_4
public static final byte G_RANGE_6
public static final byte X_AXIS
public static final byte Y_AXIS
public static final byte Z_AXIS
Constructor Detail |
---|
public AccelerationSensor(byte adcport, byte gRange)
adcport
- axis port number.gRange
- the sensitivity setting for reading the acceleration.Method Detail |
---|
public void setGRange(byte b)
Note: this is a global setting, so all accelerometer readings will reflect this setting, not just the specified axis.
b
- GRnage specified as a multiple of earth's gravity.public byte getGRange()
public void setSleep(boolean sleep)
sleep
- true if setting accelerometer to sleep, false if waking up.public void setAxis(byte b)
b
- the axis to read.public static void setRefVoltage()
public float getVref()
public javax.measure.Measurable<javax.measure.quantity.Acceleration> getResult()
getResult
in interface Sensor<javax.measure.quantity.Acceleration>
getResult
in class Adc<javax.measure.quantity.Acceleration>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |