system.setGyroscopeInterval()

Type Function
Library system.*
Return value none
Revision Release 2024.3703
Keywords gyroscope
See also gyroscope

Overview

Sets the frequency of gyroscope events in Hz. Gyroscope events are a significant drain on battery, so only increase the frequency when you need faster responses.

Gotchas

Battery Life

If possible, lower the frequency to conserve battery life.

iOS

On iOS devices, these are the frequency limits:

  • Maximum value: 100 Hz
  • Minimum value: 10 Hz

Syntax

system.setGyroscopeInterval( frequency )
frequency (required)

Number. Sets the sample interval in Hertz (cycles per second), i.e. the number of measurements to take per second. If you set the frequency to 10, then the system will take 10 measurements per second.

Examples

-- Set the measurement interval to 50 Hz.
-- This makes the system take 50 measurements per second.
system.setGyroscopeInterval( 50 )