Accelerometer

  • Description

      Accelerometer

      The Accelerometer is a non visible component that allows to detect shaking and measure acceleration approximately in three dimensions, or along the axes x,y, z. These measurements are performed even when our device is at rest.

      • xAccel: Will be 0 when the phone is resting on a flat surface, positive when the phone is tilted to the right (that is to say, his side left is high) and negative when the phone is tilted to the left.
      • yAccel: Will be 0 when the phone is resting on a flat surface, positive when its bottom is raised, and negative when its part top is high.
      • zAcel: Will be equal to -9.8 (gravity of earth in m/s/s) when the device is at rest parallel to the ground with the screen facing up, 0 when it is perpendicular to the ground, and +9.8 when facing down. The value can also be affected by speeding up with or against gravity.
  • Events

    • Acceleration Changed
    • Event that runs when it detects a change in acceleration in the dimensions X, Y and Z.
    • Shaking
    • Event that runs when the device began to stir or while stirring.
  • Properties

    • Available (boolean)
    • Allows obtiener if the Accelerometer sensor is available on the device. Getting 'True' if so and 'False' otherwise.
    • Enabled (boolean)
    • Allows you to set or obtiener if the component is or is not turned on in our application.
    • Minimum interval (number)
    • This property sets or gets the minimum interval, in milliseconds, between the shaking of the phone.
    • Sensitivity (number)
    • This property sets or gets a number that encodes how sensitive is the accelerometer. The options are: 1 = weak, 2 = moderate, 3 = strong.
    • XAccel
    • This property allows to obtain the acceleration of the X-axis of the device.
    • YAccel
    • This property allows to obtain the acceleration of the Y-axis of the device.
    • ZAccel
    • This property allows to obtain the acceleration of the Z-axis of the device.