|
SunSPOT API V6.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
IAccelerometer3D instead
public interface IAccelerometer3D
IAccelerometer3D provides methods that should be meaningful for any 3-axis accelerometer. One set of methods return the current acceleration measured along each axis. Another set of methods return the current acceleration relative to a previously measured acceleration. This allows one to zero out the force of gravity on the SPOT and measure the relative acceleration only. A third set of methods use the acceleration along an axis in order to compute the inclination, or tilt, of that axis.
| Field Summary | |
|---|---|
static boolean |
ABSOLUTE
Deprecated. |
static int |
ALL_AXES
Deprecated. |
static boolean |
RELATIVE
Deprecated. |
static int |
X_AXIS
Deprecated. |
static int |
Y_AXIS
Deprecated. |
static int |
Z_AXIS
Deprecated. |
| Method Summary | |
|---|---|
void |
addIAccelerometer3DThresholdListener(IAccelerometer3DThresholdListener who)
Deprecated. Adds the specified accelerometer threshold listener to receive callbacks from this accelerometer. |
boolean |
areThresholdEventsEnabled(int axis)
Deprecated. Return whether threshold events are enabled or not. |
void |
enableThresholdEvents(int axis,
boolean enable)
Deprecated. Enable or disable threshold events. |
double |
getAccel()
Deprecated. Compute the current total acceleration. |
double |
getAccel(int axis)
Deprecated. Compute the current acceleration for the indicated axis. |
double |
getAccelX()
Deprecated. Read the current acceleration along the X axis. |
double |
getAccelY()
Deprecated. Read the current acceleration along the Y axis. |
double |
getAccelZ()
Deprecated. Read the current acceleration along the Z axis. |
double |
getHighThreshold(int axis,
boolean relative)
Deprecated. Return the current high threshold value. |
IAccelerometer3DThresholdListener[] |
getIAccelerometer3DThresholdListeners()
Deprecated. Returns an array of all the accelerometer threshold listeners registered on this input device. |
double |
getLowThreshold(int axis,
boolean relative)
Deprecated. Return the current low threshold value. |
double |
getRelativeAccel()
Deprecated. |
double |
getRelativeAccel(int axis)
Deprecated. |
double |
getRelativeAccelX()
Deprecated. |
double |
getRelativeAccelY()
Deprecated. |
double |
getRelativeAccelZ()
Deprecated. |
double |
getTilt(int axis)
Deprecated. Compute the inclination of the specified SPOT axis. |
double |
getTiltX()
Deprecated. Compute the inclination of the SPOT's X axis. |
double |
getTiltY()
Deprecated. Compute the inclination of the SPOT's Y axis. |
double |
getTiltZ()
Deprecated. Compute the inclination of the SPOT's Z axis. |
void |
removeIAccelerometer3DThresholdListener(IAccelerometer3DThresholdListener who)
Deprecated. Removes the specified accelerometer threshold listener so that it no longer receives callbacks from this input device. |
void |
setRestOffsets()
Deprecated. |
void |
setThresholds(int axis,
double low,
double high,
boolean relative)
Deprecated. Set the low and high threshold values for this accelerometer. |
boolean |
supportsThresholdEvents()
Deprecated. Returns whether the underlying hardware supports threshold events. |
| Methods inherited from interface com.sun.spot.resources.transducers.ITransducer |
|---|
createSensorEvent, getDescription, getMaxSamplingRate, saveEventState |
| Methods inherited from interface com.sun.spot.resources.IResource |
|---|
addTag, getTags, getTagValue, hasTag, removeTag |
| Field Detail |
|---|
static final int X_AXIS
static final int Y_AXIS
static final int Z_AXIS
static final int ALL_AXES
static final boolean RELATIVE
static final boolean ABSOLUTE
| Method Detail |
|---|
double getAccelX()
throws IOException
IOException
double getAccelY()
throws IOException
IOException
double getAccelZ()
throws IOException
IOException
double getAccel()
throws IOException
IOException
double getAccel(int axis)
throws IOException
axis - which axis to return (ALL_AXES = total acceleration)
IOException
void setRestOffsets()
throws IOException
IOException
double getRelativeAccelX()
throws IOException
IOException
double getRelativeAccelY()
throws IOException
IOException
double getRelativeAccelZ()
throws IOException
IOException
double getRelativeAccel()
throws IOException
IOException
double getRelativeAccel(int axis)
throws IOException
axis - which axis to return (ALL_AXES = total acceleration)
IOException
double getTiltX()
throws IOException
IOException
double getTiltY()
throws IOException
IOException
double getTiltZ()
throws IOException
IOException
double getTilt(int axis)
throws IOException
axis - which axis to return Note: specifying ALL_AXES will throw an IllegalArgumentException.
IOExceptionboolean supportsThresholdEvents()
void addIAccelerometer3DThresholdListener(IAccelerometer3DThresholdListener who)
who - the accelerometer threshold listener to add.void removeIAccelerometer3DThresholdListener(IAccelerometer3DThresholdListener who)
who - the accelerometer threshold listener to remove.IAccelerometer3DThresholdListener[] getIAccelerometer3DThresholdListeners()
void setThresholds(int axis,
double low,
double high,
boolean relative)
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.
double getLowThreshold(int axis,
boolean relative)
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.
double getHighThreshold(int axis,
boolean relative)
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.
void enableThresholdEvents(int axis,
boolean enable)
axis - which axis to enableenable - if true then listeners will be notified if the scalar input
reading goes above the high threshold or below the low threshold.boolean areThresholdEventsEnabled(int axis)
axis - which axis to return Note: specifying ALL_AXES will return true
only if all three axes are enabled.
|
SunSPOT API V6.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||