Accelerometer Class
The accelerometer (https://w3c.github.io/accelerometer/#accelerometer-interface): the acceleration of the device along its axes, including the gravity, in m/s² rounded to 0.1 m/s². It reads the DeviceSensorType.Accelerometer sensor of the device, and needs the accelerometer permission and permissions policy feature.
public class Accelerometer : Sensor- Inheritance
SensorAccelerometer
Constructors
| Name | Description |
|---|---|
| Accelerometer(AccelerometerSensorOptions?) | Creates an accelerometer. Throws a SecurityError DomException when the document is not allowed to use the accelerometer feature. |
Accelerometer(AccelerometerSensorOptions?)
MotionSensors.csCreates an accelerometer. Throws a SecurityError DomException when the document is not allowed to use the accelerometer feature.
public Accelerometer(AccelerometerSensorOptions? options = null)Properties
| Name | Description |
|---|---|
| X | Gets the acceleration along the X axis, or null. |
| Y | Gets the acceleration along the Y axis, or null. |
| Z | Gets the acceleration along the Z axis, or null. |
Gets the acceleration along the X axis, or null.
public double? X { get; }Gets the acceleration along the Y axis, or null.
public double? Y { get; }Gets the acceleration along the Z axis, or null.
public double? Z { get; }