This API enables the user to register the strength of motion on the mobile device.

MotionMeter measures the strength of motion on the mobile device, in which strength is similar to the speed of the device. MotionMeter also integrates the strength into a progress value that starts at 0 and increases as the device is moved. The API fires continuously. MotionMeter relies on the device's Accelerometer sensor.


var msMotionMeter = new MotionStack.MotionMeter({
  strengthReduction: 10,
  maxStrength: 5

msMotionMeter.start(function (e) {

  if (e.progress == 1) {


new MotionStack.MotionMeter([options])

Create a new MotionMeter instance object.

Argument Type Description
options Object Options to pass in for the new MotionMeter instance (optional)

  • strengthReduction {Number}
  • Reduce the strength by this amount, while keeping the reduced strength above zero.

    Default: 0.1

  • maxStrength {Number}
  • Maximum allowed strength after the strengthReduction is applied.

    Default: 50

  • fireOnAnimationFrame {Boolean}
  • Only emit the latest event within requestAnimationFrame intervals.

    Default: false

var msMotionMeter = new MotionStack.MotionMeter({
  strengthReduction: 0.1,
  maxStrength: 50

Instance Methods

start(callback, [context])

Start receiving shake progress updates.

Argument Type Description
callback Function Callback function that receives an object as an argument

  • function(e)
  • e.strength {Number}
    The strength of the detected motion in meters per seconds squared. Has a similar profile to speed but with a different magnitude.
  • e.progress {Number}
    Starts at 0 and integrates the strength over time.
  • e.timeStamp {Number}
    The time in milliseconds when progress was updated.
context Object Context in which to invoke the callback (optional).
MotionMeter.start(function(e) {


Stop MotionMeter updates.