Use this API to start the accelerometer sensor. After calling this, you can useDocumentation Index
Fetch the complete documentation index at: https://docs.rebellapp.com/llms.txt
Use this file to discover all available pages before exploring further.
my.onAccelerometerChange to receive accelerometer data.
Parameters
| Property | Type | Required | Description |
|---|---|---|---|
| interval | String | No | Data reporting interval: game (20ms), ui (60ms), normal (200ms). Default: normal |
| success | Function | No | Callback on success |
| fail | Function | No | Callback on failure |
| complete | Function | No | Callback that always executes |
Code Example
Basic Usage
High Frequency for Games
Motion Tracking App
Interval Options
| Value | Update Frequency | Use Case |
|---|---|---|
game | ~50 times/sec (20ms) | Games requiring real-time response |
ui | ~16 times/sec (60ms) | UI animations and interactions |
normal | ~5 times/sec (200ms) | General motion detection |
Related APIs
my.onAccelerometerChange
Listen for accelerometer data
my.offAccelerometerChange
Stop listening