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

> Start listening for gyroscope data.

Use this API to start listening for gyroscope data. Listening starts automatically when the API is called; register listeners with `my.onGyroscopeChange` and call `my.stopGyroscope` to stop.

## 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. Receives `error` (Number, error code) and `errorMessage` (String) |
| complete | Function | No | Callback that always executes |

## Code Example

```javascript theme={null}
my.startGyroscope({
  interval: 'ui',
  success() {
    my.onGyroscopeChange((res) => {
      console.log(res.x, res.y, res.z);
    });
  }
});
```

## Related APIs

> [card] [my.onGyroscopeChange](https://docs.rebellapp.com/jsapi/device/gyroscope/my.onGyroscopeChange.md)
>
> Listen for gyroscope data

> [card] [my.stopGyroscope](https://docs.rebellapp.com/jsapi/device/gyroscope/my.stopGyroscope.md)
>
> Stop the gyroscope


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