Accelerometer

Measure linear acceleration along X, Y, and Z axes in m/s2

  • Library:
  • Simulink Support Package for Apple iOS Devices / Sensors

Description

The block measures linear acceleration along the X, Y, and Z axes. Units are in m/s2.

The figure shows the orientation of the positive X, Y, and Z axes for the Apple iOS device.

The orientation of the axes relative to the device remains constant. For example, if you place the device face-up on a table, the Z-axis measures the acceleration of Earth’s gravity and outputs about 9.81 m/s2. The X and Y axes, which are perpendicular to the acceleration of Earth’s gravity, both output about 0.00 m/s2.

Note

During simulation with no hardware connected, this block does nothing. For more information, see Block Produces Zeros or Does Nothing in Simulation (Simulink).

Ports

Output

expand all

Accelerometer data of the device, returned as a three-element numeric vector of the form [X,Y,Z].

Data Types: single

Parameters

expand all

Specify a discrete time interval, in seconds, at which the block reads the accelerometer sensor of the device and outputs the data.

Note

Smaller values for Sample time require the processor to complete the same number of instructions in less time, which can cause task overruns.

Introduced in R2015a