Gyroscope: Gyroscope() constructor
Sensor API
Sensor API
The **`Gyroscope()`** constructor
creates a new Gyroscope object which provides on each reading the
angular velocity of the device along all three axes.
## Syntax
```js-nolint
new Gyroscope()
new Gyroscope(options)
```
### Parameters
- `options`
- : Options are as follows:
- `frequency`
- : The desired number of times per second a sample should
be taken, meaning the number of times per second that the
reading event will be called. A whole number or decimal may be
used, the latter for frequencies less than a second. The actual reading frequency
depends on device hardware and consequently may be less than requested.
- `referenceFrame`
- : Either `'device'` or
`'screen'`. The default is `'device'`.
### Exceptions
- `SecurityError` DOMException
- : Use of this feature was blocked by a [Permissions Policy](/docs/Web/HTTP/Guides/Permissions_Policy).
## Specifications
## Browser compatibility
## See also
- reading event
Cite this
"Gyroscope: Gyroscope() constructor". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/Gyroscope/Gyroscope JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy