Use this API to listen for accelerometer data changes. The callback provides x, y, and z axis acceleration values.Documentation Index
Fetch the complete documentation index at: https://docs.rebellapp.com/llms.txt
Use this file to discover all available pages before exploring further.
Parameters
| Property | Type | Required | Description |
|---|---|---|---|
| callback | Function | Yes | Callback function when accelerometer data changes |
Callback Parameters
| Property | Type | Description |
|---|---|---|
| x | Number | Acceleration along X axis |
| y | Number | Acceleration along Y axis |
| z | Number | Acceleration along Z axis |
Code Example
Basic Usage
Motion Detection
Tilt Detection for Games
Related APIs
my.offAccelerometerChange
Stop listening for changes
my.startAccelerometer
Start accelerometer