|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.phidgets.Phidget
com.phidgets.AccelerometerPhidget
public final class AccelerometerPhidget
This class represents a Phidget Accelerometer. All methods to read acceleration data from an Accelerometer are implemented in this class.
The Phidget Accelerometer provides 2-3 axes of acceleration data, at anywhere from 2g to 10g sensitivity, depending on the specific revision. See your hardware documetation for more information. They can measure both static (gravity) and dynamic acceleration.
Constructor Summary | |
---|---|
AccelerometerPhidget()
|
Method Summary | |
---|---|
void |
addAccelerationChangeListener(AccelerationChangeListener l)
Adds an acceleration change listener. |
double |
getAcceleration(int index)
Returns the acceleration of a particular axis. |
double |
getAccelerationChangeTrigger(int index)
Returns the change trigger for an Axis. |
int |
getAxisCount()
Returns the number of accelerometer axes. |
void |
removeAccelerationChangeListener(AccelerationChangeListener l)
|
void |
setAccelerationChangeTrigger(int index,
double newVal)
Sets the change trigger for an Axis. |
Methods inherited from class com.phidgets.Phidget |
---|
addAttachListener, addDetachListener, addErrorListener, close, equals, getDeviceName, getDeviceType, getDeviceVersion, getLibraryVersion, getSerialNumber, getTag, isAttached, open, openAny, removeAttachListener, removeDetachListener, removeErrorListener, setTag, toString, waitForAttachment |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AccelerometerPhidget() throws PhidgetException
PhidgetException
Method Detail |
---|
public int getAxisCount() throws PhidgetException
PhidgetException
public double getAcceleration(int index) throws PhidgetException
Index 0 is the x-axis, 1 is the y-axis, and 2 is the z-axis (where available).
index
- index of the axis
PhidgetException
- If this Phidget is not opened and attached, or if the index is out of range.
See open
for information on determining if a device is attached.public void setAccelerationChangeTrigger(int index, double newVal) throws PhidgetException
index
- index of the axisnewVal
- the new change trigger for this axis
PhidgetException
- If this Phidget is not opened and attached, or if the index is out of range.
See open
for information on determining if a device is attached.public double getAccelerationChangeTrigger(int index) throws PhidgetException
index
- index of the axis
PhidgetException
- If this Phidget is not opened and attached, or if the index is out of range.
See open
for information on determining if a device is attached.public final void addAccelerationChangeListener(AccelerationChangeListener l)
Trigger
that has been set for that axis.
There is no limit on the number of acceleration change handlers that can be registered for a particular Phidget.
l
- An implemetation of the AccelerationChangeListener
interfacepublic final void removeAccelerationChangeListener(AccelerationChangeListener l)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |