calibrateAccelerometer
Calibrates the accelerometer (acceleration sensor).
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"params" | Object | undefined | null |
Parameters
Key | Type | Description | Default Value |
---|---|---|---|
"async" | Boolean | Specifies whether the action should perform asynchronously. | null |
"delay" | Number,String | Number of milliseconds after which the calibration is performed. | null |
"onError" | String | Event that is fired if the calibration was not successful. | null |
"onErrorType" | OnErrorType | Type of event that will be fired on error. | null |
"onSuccess" | String | Event that is fired if the calibration was successful. | null |
"onSuccessType" | OnSuccessType | Type of event that will be fired on success. | null |
Inherited
From Base Action
Base Action
Field Configurations
Key | Type | Description | Default Value |
---|---|---|---|
"dynamicParams" | Object | Dynamic params to retrieve data from a specific context e.g. a userSetting. | null |
"leadingDelimiter" | String | The leading mustache delimiter to use. | null |
"params" | Object,Array | Object containing the properties of the action. | null |
"trailingDelimiter" | String | The trailing mustache delimiter to use. | null |
"type" | String | Type name of the action. | null |
Examples
Example 1: Calibrate the accelerometer
Goal: Create a calibrateAccelerometer action performing a calibration after 1 second.
To achieve this the following code can be used:
{
"type": "calibrateAccelerometer",
"params": {
"delay": "1000",
"onSuccess": "calibrationSuccess",
"onError": "calibrationError"
}
}
The delay
parameter specifies the delay in milliseconds, so that a value of 1000
corresponds to 1 second.
Result:
A calibrateAccelerometer action has been created.