PicoPicoGameEngine

Quick Links

Accelerometer Object

ppaccelerometer

:start()

Start accelerometer.

ppaccelerometer:start(interval)
interval : number

ac=ppaccelerometer

ac:start(0.01)

function start()
  local v=ac:value()
  ppgraph:print("X:"..v.x)
  ppgraph:move(0,16)
  ppgraph:print("Y:"..v.y)
  ppgraph:move(0,16)
  ppgraph:print("Z:"..v.z)
end

:stop()

Stop accelerometer.

ppaccelerometer:stop()

:isAvailable()

flag = ppaccelerometer:isAvailable()
flag : boolean

  • true
  • false

:value()

val = ppaccelerometer:value()
val : object

{
  x=[X value],
  y=[Y value],
  z=[Z value]
}