public interface Accelerometer extends MetaWearController.ModuleController
Module.ACCELEROMETER
Modifier and Type | Interface and Description |
---|---|
static interface |
Accelerometer.AccelerometerConfig
Provides optional configuration options to allow users to customize the
accelerometer detection
|
static class |
Accelerometer.Axis
Axes available for motion detection.
|
static class |
Accelerometer.Callbacks
Callbacks for the accelerometer module
|
static class |
Accelerometer.Component
Enumeration of components in the accelerometer
|
static interface |
Accelerometer.MovementData
Wrapper class encapsulating movement information received from the board
|
static class |
Accelerometer.Orientation
Orientation definitions for the accelerometer.
|
static class |
Accelerometer.PowerMode
Enumeration of the available power modes on the accelerometer
|
static class |
Accelerometer.Register
Enumeration of registers for the accelerometer module
|
static interface |
Accelerometer.SamplingConfig
Configure attributes for data sampling
|
static class |
Accelerometer.SleepModeRate
Enumeration of sleep mode data rates
|
static interface |
Accelerometer.TapConfig
Configure attributes for tap detection
|
static interface |
Accelerometer.TapData
Wrapper class encapsulating tap data received from the on-board logger.
|
static class |
Accelerometer.TapType
Detectable tap types
|
static interface |
Accelerometer.ThresholdConfig
Configure threshold level for accelerometer components
|
Modifier and Type | Method and Description |
---|---|
void |
disableAllDetection(boolean saveConfig)
Disable detection for all components.
|
void |
disableAutoSleepMode()
Disables auto sleep mode on the accelerometer
|
void |
disableComponent(Accelerometer.Component component)
Disable accelerometer activity for the given component.
|
void |
disableDetection(Accelerometer.Component component,
boolean saveConfig)
Disable detection for the accelerometer component.
|
void |
disableNotification(Accelerometer.Component component)
Deprecated.
As of v1.1, use
disableComponent(Accelerometer.Component) |
void |
enableAutoSleepMode()
Enables auto sleep mode on the accelerometer.
|
void |
enableAutoSleepMode(Accelerometer.SleepModeRate sleepRate,
int timeout)
Enables auto sleep mode on the accelerometer.
|
void |
enableComponent(Accelerometer.Component component,
boolean notify)
Enables accelerometer activity for the given component
|
Accelerometer.ThresholdConfig |
enableFreeFallDetection()
Enable free fall detection.
|
Accelerometer.ThresholdConfig |
enableMotionDetection(Accelerometer.Axis... axes)
Enable motion detection.
|
void |
enableNotification(Accelerometer.Component component)
Deprecated.
As of v1.1, use
enableComponent(Accelerometer.Component, boolean) |
Accelerometer.AccelerometerConfig |
enableOrientationDetection()
Enable orientation detection.
|
Accelerometer.ThresholdConfig |
enableShakeDetection(Accelerometer.Axis axis)
Enable shake detection.
|
Accelerometer.TapConfig |
enableTapDetection(Accelerometer.TapType type,
Accelerometer.Axis axis)
Enable tap detection.
|
Accelerometer.SamplingConfig |
enableXYZSampling()
Enable data sampling of the XYZ axes.
|
void |
readComponentConfiguration(Accelerometer.Component component)
Read component configuration.
|
void |
resetAll()
Resets configuration and stops detection for all components
|
void |
setComponentConfiguration(Accelerometer.Component component,
byte[] data)
Set component configuration
|
void |
setPowerMode(Accelerometer.PowerMode mode)
Sets the power mode of the accelerometer
|
void |
startComponents()
Starts detection / sampling of enabled components
|
void |
stopComponents()
Stops activity for enabled components
|
void disableDetection(Accelerometer.Component component, boolean saveConfig)
component
- Component to disablesaveConfig
- True if the component configuration should be savedvoid disableAllDetection(boolean saveConfig)
saveConfig
- True if the all configurations should be savedAccelerometer.TapConfig enableTapDetection(Accelerometer.TapType type, Accelerometer.Axis axis)
type
- Tap type to detectedaxis
- Which axis to detect taps onAccelerometer.Callbacks.singleTapDetected(Accelerometer.MovementData)
,
Accelerometer.Callbacks.doubleTapDetected(Accelerometer.MovementData)
Accelerometer.ThresholdConfig enableShakeDetection(Accelerometer.Axis axis)
Accelerometer.Callbacks.shakeDetected(Accelerometer.MovementData)
callback
function is calledaxis
- Which axis to detect shake motionAccelerometer.AccelerometerConfig enableOrientationDetection()
Accelerometer.Callbacks.orientationChanged(Accelerometer.Orientation)
callback function
is called.Accelerometer.ThresholdConfig enableFreeFallDetection()
enableMotionDetection(Accelerometer.Axis...)
, you can only enable one or the
other. When free fall is detected, the Accelerometer.Callbacks.movementDetected(Accelerometer.MovementData)
callback function is calledAccelerometer.ThresholdConfig enableMotionDetection(Accelerometer.Axis... axes)
enableFreeFallDetection()
, you can only enable one or the
other. When motion is detected, the Accelerometer.Callbacks.movementDetected(Accelerometer.MovementData)
callback function is calledaxes
- Axis to detect motion onAccelerometer.SamplingConfig enableXYZSampling()
Accelerometer.Callbacks.receivedDataValue(short, short, short)
callback function is calledvoid startComponents()
void stopComponents()
void resetAll()
void enableAutoSleepMode()
void enableAutoSleepMode(Accelerometer.SleepModeRate sleepRate, int timeout)
sleepRate
- Data rate the accelerometer operates at while in sleep modetimeout
- how long the accelerometer should idle in active mode before switching
to sleep modevoid disableAutoSleepMode()
void setPowerMode(Accelerometer.PowerMode mode)
mode
- Power mode to usevoid enableComponent(Accelerometer.Component component, boolean notify)
component
- Component to enablenotify
- True if the API should be notified of accelerometer events.
If set to false, the assoicated callback function will not be called.void disableComponent(Accelerometer.Component component)
disableNotification(Accelerometer.Component)
component
- Component to disablevoid enableNotification(Accelerometer.Component component)
enableComponent(Accelerometer.Component, boolean)
component
- Component to enable notifications fromvoid disableNotification(Accelerometer.Component component)
disableComponent(Accelerometer.Component)
component
- Component to disable notifications fromvoid readComponentConfiguration(Accelerometer.Component component)
Accelerometer.Callbacks.receivedConfiguration(Accelerometer.Component, byte[])
callback function
will be calledcomponent
- Component to read configuration fromAccelerometer.Callbacks.receivedConfiguration(Accelerometer.Component, byte[])
void setComponentConfiguration(Accelerometer.Component component, byte[] data)
component
- Component to write configuration to