Measure linear acceleration along X, Y, and Z axes
Simulink Support Package for Android Devices / Sensors
Get the measurement of acceleration in m/s2 in the X, Y, and Z directions from the accelerometer on the Android™ device.
The Accelerometer block has three outputs:
Z. Each port outputs a
The following illustration shows the X, Y, and Z orientation axes relative to a typical Android mobile phone.
The following illustration shows the X, Y, and Z orientation axes relative to a typical Android tablet.
The X, Y, and Z orientation axes relative to the device remain constant. For example, if you place the device face-up on a table, the Z-axis measures the acceleration of Earth gravity and outputs ≈9.81 in m/s2. The X and Y axes, which are perpendicular to the acceleration of Earth gravity, both output ≈0.00 in m/s2.
During simulations without hardware, this block outputs zeros. See Block Produces Zeros or Does Nothing in Simulation.
- Sample time
Specify how often the block reads the sensor.
Smaller values require the processor to complete the same number of instructions in less time, which can cause task overruns.