Get measurement of linear acceleration along the X, Y, and Z axes of the MMA8652FC 3-Axis chip
Simulink Coder Support Package for BBC micro:bit/Accelerometer
The MMA8652FC 3-Axis Accelerometer block measures the linear acceleration along
the X, Y, and Z axes. The block has one output port, Accel. The Accel port outputs the
acceleration from the as a
[1x3] vector in
Using the parameters of this block, you can change the accelerometer
sensitivity by selecting a full-scale range of
You can also select the Output Data Rates (ODR) for both of
the sensors. The Output Data Rates (ODR) ranges from
Hold the board so that the board faces you and the line to the top of the MMA8652FC 3-Axis chip is aligned horizontally to the table. At this position, the X-axis is horizontal and points to the left, the Y-axis is vertical and points down, and the Z-axis points toward you.
The direction of the arrows shows the positive direction of the reading for the accelerometer.
When you tilt the board along the X, Y, and Z axes of the chip, this illustration shows the acceleration.
Hold the board so that the board faces you and the line to the right of the chip is aligned vertically to the table. The acceleration of gravity is static because the chip is stationary.
In the resultant
[1x3] vector, the first
value that represents the acceleration at the X-axis ≈
g (9.81 m/s2). The last two values
that represent the acceleration at the Y and Z axes (perpendicular
to the acceleration of earth gravity) ≈
Push the board upward with an acceleration of
The acceleration of the gravity is dynamic and equal to the acceleration
of the block minus the force of gravity ≈
m/s2. In the resultant
the value of the X-axis ranges between the full-scale range value
that you specify in the Acceleration full scale range parameter.
The block has one output port.
Accel— Acceleration applied to the sensor along each axis of the chip
The block outputs the acceleration as a
Each value represents the measurement of the acceleration in
(9.8 m/s2) along the X, Y, and
Sensor output data rate (ODR)— Rate at which data is sampled
Specify the rate at which you want the accelerometer to read the measurement of acceleration.
Acceleration full scale range— Range of acceleration deviation that the accelerometer can measure
-4g to +4g(default) |
-2g to +2g|
-8g to +8g
Accelerometer sensitivity is
256 counts/g in
4 g mode,
8 g mode.
A small, full scale range means that the sensor sensitivity is heightened,
resulting in a more precise reading from the accelerometer.
Sample time— Specify how often the block reads data from the accelerometer on the chip
When you specify this parameter as
determines the best sample time for the block based on the block context
within the model.