Component: Accelerometer 3-Axis (MMA8452Q) (Movement Orientation): Difference between revisions
Appearance
m Text replacement - "class="wikitable" style="width:60%; background-color:#FFFFFF;"" to "class="mtx-class-macrotable wikitable"" |
m Text replacement - "width="10%" align="center" style="background-color:#D8C9D8;" align="center"" to "width="10%" align="center" class="mtx-class-macrohead"" |
||
| Line 96: | Line 96: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CollectXYZData''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''CollectXYZData''' | ||
|- | |- | ||
| Line 115: | Line 115: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' | ||
|- | |- | ||
| Line 129: | Line 129: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Read_N_Registers''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Read_N_Registers''' | ||
|- | |- | ||
| Line 158: | Line 158: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Read_Register''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Read_Register''' | ||
|- | |- | ||
| Line 177: | Line 177: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SimReset1G''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SimReset1G''' | ||
|- | |- | ||
| Line 191: | Line 191: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SimSetXYZ''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SimSetXYZ''' | ||
|- | |- | ||
| Line 220: | Line 220: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UpdateXYZData''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UpdateXYZData''' | ||
|- | |- | ||
| Line 234: | Line 234: | ||
{| class="mtx-class-macrotable wikitable" | {| class="mtx-class-macrotable wikitable" | ||
|- | |- | ||
| width="10%" align="center" | | width="10%" align="center" class="mtx-class-macrohead" | [[File:Fc9-comp-macro.png]] | ||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Write_Register''' | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Write_Register''' | ||
|- | |- | ||
Revision as of 14:17, 13 July 2026
| Author | Matrix Ltd. |
| Version | 2.0 |
| Category | Movement Orientation |
Accelerometer 3-Axis (MMA8452Q) component
MMA8452Q Accelerometer sensor with I2C. Useful for approximating Pitch and Roll or for detecting acceleration.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_Accelerometer_MMA8452Q.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_Accelerometer_MMA8452Q.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
CollectXYZData
Initialise
| Initialise | |
| Sets up up the communication bus and initialises the accelerometer module. Returns 0 for success and > 0 for fail. | |
| Return | |
Read_N_Registers
Read_Register
| Read_Register | |
| Reads a value from a register on the accelerometer. | |
| Reg | |
| Register address to read from | |
| Return | |
SimReset1G
| SimReset1G | |
| Resets the simulation to 0.0 on X and Y and 1.0 on Z as if the accelerometer was sitting completely horizontal. | |
| Return | |
SimSetXYZ
| SimSetXYZ | |
| Allows the XYZ slider values to be set via the simulation | |
| X | |
| Y | |
| Z | |
| Return | |
UpdateXYZData
| UpdateXYZData | |
| Reads from the accelerometer and updates the local XYZ variables. Returns 1 for new data and 0 for no new data | |
| Return | |
Write_Register
| Write_Register | |
| Writes a data value to a specific register on the accelerometer | |
| Reg | |
| Register Address to Write to | |
| Data | |
| Value to write to the register | |
| Return | |