Type Function Library system.* Return value none Revision 2017.3060 Keywords accelerometer See also accelerometer
Sets the frequency of accelerometer events.
On both Android and iOS, the default value is not documented but it is typically low, for example 10 Hz.
Accelerometer events are a significant drain on the battery, so only increase the frequency when you need faster responses.
plist
table of build.settings
. When the system prompts the user to allow access, the associated description is displayed as part of the alert. Note that these descriptions can be customized to your preference and they can even be localized (guide).settings = { iphone = { plist = { NSMotionUsageDescription = "This app would like to access the accelerometer.", }, }, }
system.setAccelerometerInterval( frequency )
Number. The measurement interval in Hz.
-- Set the measurement interval to 50 Hz -- This makes the system take 50 measurements per second system.setAccelerometerInterval( 50 )