×
A new build of Corona SDK is now available to subscribers. Not a subscriber? Subscribe now.
CoronaSDK 2012.821 | Released: 23 May 2012, 2:01am | What's New | Download Now

system.setGyroscopeInterval()

Description:

Sets the frequency of gyroscope events in Hertz. Gyroscope events are a significant drain on battery, so only increase the frequency when you need faster responses as in games. Always try to lower the frequency whenever possible to conserve battery life.

Syntax:

system.setGyroscopeInterval( frequency )

Example:

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

Parameters:

frequency

Sets the sample interval in Hertz.

Hertz is cycles per second, or in this case, the number of measurements to take per second. So, if you set the frequency to 10, then the system will take 10 measurements per second.

Maximum value allowed: 100 Hz
Minimum value allowed: 10 Hz

Returns:

Nothing

Remarks:
Supported on operating systems and platforms for build numbers shown:
  • Mac OS X:
    --
  • Windows:
    --
  • iOS:
    Build 2011.544
  • Android:
    Build 2011.544