> ## 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.

# my.startDeviceMotionListening

> Start listening for device orientation changes.

Use this API to start listening for changes in the device's orientation. Register listeners with `my.onDeviceMotionChange`.

## Parameters

| Property | Type | Required | Description |
| - | - | - | - |
| interval | String | No | Callback frequency: `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 |

## Error Codes

| Code | Description | Action |
| - | - | - |
| 1001 | The system doesn't support the relevant capabilities | Try again with a different device |

## Code Example

```javascript theme={null}
my.startDeviceMotionListening({
  interval: 'ui',
  success() {
    my.onDeviceMotionChange((res) => {
      console.log(res.alpha, res.beta, res.gamma);
    });
  },
  fail(err) {
    console.error(err);
  }
});
```

## Related APIs

> [card] [my.onDeviceMotionChange](https://docs.rebellapp.com/jsapi/device/device-motion/my.onDeviceMotionChange.md)
>
> Listen for orientation changes

> [card] [my.stopDeviceMotionListening](https://docs.rebellapp.com/jsapi/device/device-motion/my.stopDeviceMotionListening.md)
>
> Stop listening


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.