Skip to main content
Use this API to register a listener for gyroscope data updates. Events are delivered only after my.startGyroscope has been called, at the frequency set by its interval parameter.

Coordinate System

  • x-axis: horizontal, from left to right across the screen (rotation = tilting the device forward/backward)
  • y-axis: vertical, from the bottom to the top of the screen (rotation = tilting the device left/right)
  • z-axis: perpendicular to the screen, pointing outward (rotation = turning the device on a flat surface)

Parameters

Listener Callback

Code Example

my.startGyroscope

Start the gyroscope

my.offGyroscopeChange

Remove gyroscope listeners