Difference between revisions of "X Accelerometer Introduction"

From GiderosMobile
m (removed category reference)
(Undo revision 14873 by MoKaLux (talk))
Tag: Undo
Line 1: Line 1:
<!--[[Category: Accelerometer]]-->
+
[[Category: Accelerometer]]
 
The Accelerometer class is used to access accelerometer data.
 
The Accelerometer class is used to access accelerometer data.
  

Revision as of 00:29, 9 December 2019

The Accelerometer class is used to access accelerometer data.

--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()