Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
com.phidgets.AccelerometerPhidget Class Reference
Inheritance diagram for com.phidgets.AccelerometerPhidget:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 AccelerometerPhidget () throws PhidgetException
final void addAccelerationChangeListener (AccelerationChangeListener l)
native double getAcceleration (int index) throws PhidgetException
native double getAccelerationChangeTrigger (int index) throws PhidgetException
native double getAccelerationMax (int index) throws PhidgetException
native double getAccelerationMin (int index) throws PhidgetException
native int getAxisCount () throws PhidgetException
final void removeAccelerationChangeListener (AccelerationChangeListener l)
native void setAccelerationChangeTrigger (int index, double newVal) throws PhidgetException

Private Member Functions

native void enableAccelerationChangeEvents (boolean b)
final void enableDeviceSpecificEvents (boolean b)
void fireAccelerationChange (AccelerationChangeEvent e)

Static Private Member Functions

static native long create () throws PhidgetException

Private Attributes

LinkedList accelerationChangeListeners = new LinkedList ()
long nativeAccelerationChangeHandler = 0

Detailed Description

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 or 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.

Author:
Phidgets Inc.

Definition at line 20 of file AccelerometerPhidget.java.


Constructor & Destructor Documentation

Definition at line 22 of file AccelerometerPhidget.java.


Member Function Documentation

final void com.phidgets.AccelerometerPhidget.addAccelerationChangeListener ( AccelerationChangeListener  l) [inline]

Adds an acceleration change listener. The acceleration change handler is a method that will be called when the acceleration of an axis has changed by at least the 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.

Parameters:
lAn implemetation of the AccelerationChangeListener interface

Definition at line 93 of file AccelerometerPhidget.java.

static native long com.phidgets.AccelerometerPhidget.create ( ) throws PhidgetException [static, private]

Reimplemented from com.phidgets.Phidget.

Definition at line 81 of file AccelerometerPhidget.java.

void com.phidgets.AccelerometerPhidget.fireAccelerationChange ( AccelerationChangeEvent  e) [inline, private]

Definition at line 107 of file AccelerometerPhidget.java.

Returns the acceleration of a particular axis. This value is returned in g's, where one g of acceleration is equal to gravity. This means that at a standstill each axis will measure between -1.0 and 1.0 g's depending on orientation.

This value will always be between getAccelerationMin and getAccelerationMax.

Index 0 is the x-axis, 1 is the y-axis, and 2 is the z-axis (where available).

Parameters:
indexindex of the axis
Returns:
acceleration of the selected axis
Exceptions:
PhidgetExceptionIf 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.

Returns the change trigger for an Axis. This value is in g's and is by default set to 0.

Parameters:
indexindex of the axis
Returns:
change trigger of the selected axis
Exceptions:
PhidgetExceptionIf 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.

Returns the maximum acceleration value that this axis will report. This will be set to just higher then the maximum acceleration that this axis can measure. If the acceleration is equal to this maximum, assume that that axis is saturated beyond what it can measure.

Returns:
maximum acceleration

Returns the minimum acceleration value that this axis will report. This will be set to just lower then the minimum acceleration that this axis can measure. If the acceleration is equal to this minimum, assume that that axis is saturated beyond what it can measure.

Returns:
minimum acceleration

Returns the number of accelerometer axes. Currently all accelerometers provide two or three axes of acceleration - x, y, (and z).

Returns:
number of axes of acceleration
final void com.phidgets.AccelerometerPhidget.removeAccelerationChangeListener ( AccelerationChangeListener  l) [inline]

Definition at line 101 of file AccelerometerPhidget.java.

Sets the change trigger for an Axis. This value is in g's and is by default set to 0. This is the difference in acceleration that must appear between succesive calls to the OnAccelerationChange event handler.

Parameters:
indexindex of the axis
newValthe new change trigger for this axis
Exceptions:
PhidgetExceptionIf 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.

Member Data Documentation

LinkedList com.phidgets.AccelerometerPhidget.accelerationChangeListeners = new LinkedList () [private]

Definition at line 99 of file AccelerometerPhidget.java.

Definition at line 100 of file AccelerometerPhidget.java.


The documentation for this class was generated from the following file:


pedal_monitor
Author(s): Pedro Mendes
autogenerated on Fri Jun 6 2014 18:37:22