Difference between revisions of "Component: Accelerometer 3-Axis (MMA8452Q) (Movement Orientation)"
From Flowcode Help
Jump to navigationJump to search (Created page with "{| style="width:50%" |- | width="20%" style="color:gray;" | Author | Matrix Ltd. |- | width="20%" style="color:gray;" | Version | 2.0 |- | width="20%" style="color:gra...") |
|||
| Line 20: | Line 20: | ||
==Detailed description== | ==Detailed description== | ||
| + | |||
| + | |||
| Line 36: | Line 38: | ||
==Examples== | ==Examples== | ||
| + | |||
| + | |||
Revision as of 14:39, 16 January 2023
| Author | Matrix Ltd. |
| Version | 2.0 |
| Category | Movement Orientation |
Contents
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 for the component source code: FC_Comp_Source_Accelerometer_MMA8452Q.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Downloadable macro reference
| Read_Register | |
| Reads a value from a register on the accelerometer. | |
| Reg | |
| Register address to read from | |
| Return | |
| 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 | |
| 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 | |
| UpdateXYZData | |
| Reads from the accelerometer and updates the local XYZ variables. Returns 1 for new data and 0 for no new data | |
| Return | |
| SimSetXYZ | |
| Allows the XYZ slider values to be set via the simulation | |
| X | |
| Y | |
| Z | |
| Return | |
| Initialise | |
| Sets up up the communication bus and initialises the accelerometer module. Returns 0 for success and > 0 for fail. | |
| Return | |