accelerometer Object

Use the accelerometer object to listen to the device's motion sensor


The accelerometer is the device on a smartphone that detects movement. The accelerometer object is used to track the accelerometer on the device. Success and failure callback functions need to be defined in your Javascript. Successful data is returned as an object with the attributes ".x", ".y", and ".z". Values of accelerometer samples for each axis range from -1 to 1.


Para obtener información más completa sobre las optimizaciones del compilador, consulte nuestro Aviso de optimización.