public class ADXL345 extends Object implements ImuInterface
Modifier and Type | Class and Description |
---|---|
static class |
ADXL345.OutputDataRateType |
Constructor and Description |
---|
ADXL345() |
Modifier and Type | Method and Description |
---|---|
void |
addOrientationListener(OrientationListener listener) |
void |
addTapListener(TapListener listener) |
org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
getAccelerometerData() |
int |
getAccelFsr() |
byte |
getActivityInactivityControlFlags()
D7 - Activity ac/dc
D6 - ACT_X enable
D5 - ACT_Y enable
D4 - ACT_Z enable
D3 - Inactivity ac/dc
D2 - INACT_X enable
D1 - INACT_Y enable
D0 - INACT_Z enable
A setting of 0 selects dc-coupled operation, and a setting of 1 enables ac-coupled operation.
|
float |
getActivityThreshold() |
ADXL345.OutputDataRateType |
getBandwidthDataRate() |
org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
getCompassData() |
byte |
getFifoControlFlags()
D7 D6 | D5 | D4 D3 D2 D1 D0
FIFO_MODE | Trigger | Samples
FIFO modes:
0 Bypass - FIFO is bypassed
1 FIFO - FIFO collects up to 32 values and then stops collecting data, collecting new data only when FIFO is not full
2 Stream - FIFO holds the last 32 data values.
|
byte |
getFifoStatus()
D7 | D6 | D5 D4 D3 D2 D1 D0
FIFO Trig | 0 | Entries
FIFO Trig: A 1 in the FIFO_TRIG bit corresponds to a trigger event occurring,
and a 0 means that a FIFO trigger event has not occurred
Entries: These bits report how many data values are stored in FIFO.
|
float |
getFreefallThreshold() |
float |
getFreefallTime() |
org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
getGyroData() |
ImuData |
getImuData() |
String |
getImuName() |
float |
getInactivityThreshold() |
float |
getInactivityTime() |
byte |
getInterruptEnableFlags() |
byte |
getInterruptMapFlags() |
byte |
getInterruptSourceFlags() |
float[] |
getOffsets() |
float |
getOffsetX() |
float |
getOffsetY() |
float |
getOffsetZ() |
int |
getPollInterval()
Get the recommended poll interval in milliseconds
|
byte |
getTapActivityStatusFlags() |
float |
getTapDuration()
Get the tap duration in milliseconds
|
float |
getTapLatency()
Get the tap latency in milliseconds
|
float |
getTapThreshold()
Get the tap threshold in g
|
float |
getTapWindow()
Get the tap window in milliseconds
|
boolean |
hasAccelerometer() |
boolean |
hasCompass() |
boolean |
hasGyro() |
boolean |
isDoubleTapSuppressed() |
boolean |
isFullResolutionMode() |
boolean |
isLowPowerMode() |
boolean |
isSelfTestMode() |
void |
setAccelFsr(int range) |
void |
setActivityInactivityControlFlags(byte flags) |
void |
setActivityThreshold(float activityThreshold)
Set the activity threshold value in g
|
void |
setBandwidthRate(ADXL345.OutputDataRateType dataRate) |
void |
setDoubleTapSuppressed(boolean doubleTapSuppressed) |
void |
setFifoControlFlags(byte flags) |
void |
setFreefallThreshold(float freefallThreshold)
Set the freefall threshold value in g
|
void |
setFreefallTime(float freefallTime)
Set the freefall time value in mS
|
void |
setFullResolutionMode(boolean fullResolution) |
void |
setInactivityThreshold(float inactivityThreshold)
Set the inactivity threshold value in g
|
void |
setInactivityTime(float inactivityTime)
Set the inactivity time value in mS
|
void |
setInterruptEnableFlags(byte flags) |
void |
setInterruptMapFlagS(byte flags) |
void |
setLowPowerMode(boolean lowPowerMode) |
void |
setNormalMeasurementMode() |
void |
setOffsets(float offsetX,
float offsetY,
float offsetZ) |
void |
setOffsetX(float offset)
Set the X-axis offset in g
|
void |
setOffsetY(float offset)
Set the Y-axis offset in g
|
void |
setOffsetZ(float offset)
Set the Z-axis offset in g
|
void |
setPowerControlFlags(byte powerControlValue) |
void |
setSelfTestMode(boolean selfTest) |
void |
setTapDuration(float tapDuration)
Set the tap duration in mS
|
void |
setTapLatency(float tapLatency)
Set the tap latency in mS
|
void |
setTapThreshold(float tapThreshold)
Set the tap threshold in g
|
void |
setTapWindow(float tapWindow)
Set the tap window in mS
|
void |
startRead() |
void |
stopRead() |
public float getTapThreshold()
public void setTapThreshold(float tapThreshold)
tapThreshold
- The threshold value in g for tap interruptspublic float getOffsetX()
public void setOffsetX(float offset)
offset
- Offset value (g)public float getOffsetY()
public void setOffsetY(float offset)
offset
- Offset value (g)public float getOffsetZ()
public void setOffsetZ(float offset)
offset
- Offset value (g)public float[] getOffsets()
public void setOffsets(float offsetX, float offsetY, float offsetZ)
public float getTapDuration()
public void setTapDuration(float tapDuration)
tapDuration
- The maximum time in ms that an event must be above to qualify as a tap eventpublic float getTapLatency()
public void setTapLatency(float tapLatency)
tapLatency
- The wait time in mS from the detection of a tap event to the start of the
time window during which a possible second tap event can be detectedpublic float getTapWindow()
public void setTapWindow(float tapWindow)
tapWindow
- The amount of time in milliseconds after the expiration of the latency time
during which a second valid tap can beginpublic float getActivityThreshold()
public void setActivityThreshold(float activityThreshold)
activityThreshold
- The threshold value for detecting activitypublic float getInactivityThreshold()
public void setInactivityThreshold(float inactivityThreshold)
inactivityThreshold
- The threshold value for detecting inactivitypublic float getInactivityTime()
public void setInactivityTime(float inactivityTime)
inactivityTime
- Value representing the amount of time that acceleration must
be less than the value in the THRESH_INACT register for inactivity to be declaredpublic byte getActivityInactivityControlFlags()
public void setActivityInactivityControlFlags(byte flags)
public float getFreefallThreshold()
public void setFreefallThreshold(float freefallThreshold)
freefallThreshold
- The threshold value for detecting inactivitypublic float getFreefallTime()
public void setFreefallTime(float freefallTime)
freefallTime
- Value representing minimum time that the value of all axes
must be less than THRESH_FF to generate a freefall interruptpublic boolean isDoubleTapSuppressed()
public void setDoubleTapSuppressed(boolean doubleTapSuppressed)
public byte getTapActivityStatusFlags()
public boolean isLowPowerMode()
public void setLowPowerMode(boolean lowPowerMode)
public ADXL345.OutputDataRateType getBandwidthDataRate() throws RuntimeIOException
RuntimeIOException
public void setBandwidthRate(ADXL345.OutputDataRateType dataRate) throws RuntimeIOException
RuntimeIOException
public void setNormalMeasurementMode() throws RuntimeIOException
RuntimeIOException
public void setPowerControlFlags(byte powerControlValue) throws RuntimeIOException
RuntimeIOException
public byte getInterruptEnableFlags()
public void setInterruptEnableFlags(byte flags)
public byte getInterruptMapFlags()
public void setInterruptMapFlagS(byte flags)
public byte getInterruptSourceFlags()
public boolean isFullResolutionMode()
public void setFullResolutionMode(boolean fullResolution)
public boolean isSelfTestMode()
public void setSelfTestMode(boolean selfTest)
public int getAccelFsr()
public void setAccelFsr(int range)
public byte getFifoControlFlags()
public void setFifoControlFlags(byte flags)
public byte getFifoStatus()
public ImuData getImuData() throws RuntimeIOException
getImuData
in interface ImuInterface
RuntimeIOException
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getGyroData() throws RuntimeIOException
getGyroData
in interface ImuInterface
RuntimeIOException
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getAccelerometerData() throws RuntimeIOException
getAccelerometerData
in interface ImuInterface
RuntimeIOException
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getCompassData() throws RuntimeIOException
getCompassData
in interface ImuInterface
RuntimeIOException
public boolean hasGyro()
hasGyro
in interface ImuInterface
public boolean hasAccelerometer()
hasAccelerometer
in interface ImuInterface
public boolean hasCompass()
hasCompass
in interface ImuInterface
public void addTapListener(TapListener listener)
addTapListener
in interface ImuInterface
public void addOrientationListener(OrientationListener listener)
addOrientationListener
in interface ImuInterface
public String getImuName()
getImuName
in interface ImuInterface
public int getPollInterval()
ImuInterface
getPollInterval
in interface ImuInterface
public void startRead()
startRead
in interface ImuInterface
public void stopRead()
stopRead
in interface ImuInterface
Copyright © 2016–2018 mattjlewis. All rights reserved.