Difference between revisions of "X Accelerometer Introduction"

From GiderosMobile
(Created page with "The Accelerometer class is used to access accelerometer data. <syntaxhighlight lang=lua> --create instance local accelerometer = Accelerometer.new() --start receiving data ac...")
 
(x page to delete)
Tag: Replaced
 
(18 intermediate revisions by 2 users not shown)
Line 1: Line 1:
The Accelerometer class is used to access accelerometer data.
+
#REDIRECT [[Accelerometer]]
 
 
<syntaxhighlight lang=lua>
 
--create instance
 
local accelerometer = Accelerometer.new()
 
--start receiving data
 
accelerometer:start()
 
---get values for example on each enter frame event
 
local x, y, z = accelerometer:getAcceleration()
 
print(x, y, z)
 
 
 
--once you don't need it, stop it
 
accelerometer:stop()
 
</syntaxhighlight>
 

Latest revision as of 03:53, 4 January 2020

Redirect to: