Difference between revisions of "Component: Accelerometer 3-Axis (MMA8452Q) (Movement Orientation)"
From Flowcode Help
Jump to navigationJump to search| Line 80: | Line 80: | ||
''<span style="color:red;">No additional examples</span>'' | ''<span style="color:red;">No additional examples</span>'' | ||
| + | |||
| + | |||
| Line 85: | Line 87: | ||
==Macro reference== | ==Macro reference== | ||
| + | ===Read_Register=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 103: | Line 106: | ||
| + | ===SimReset1G=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 116: | Line 120: | ||
| + | ===Write_Register=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 139: | Line 144: | ||
| + | ===CollectXYZData=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 157: | Line 163: | ||
| + | ===UpdateXYZData=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 170: | Line 177: | ||
| + | ===Read_N_Registers=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 198: | Line 206: | ||
| + | ===SimSetXYZ=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| Line 226: | Line 235: | ||
| + | ===Initialise=== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
Revision as of 11:48, 3 February 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 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
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 | |
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 | |
CollectXYZData
UpdateXYZData
| UpdateXYZData | |
| Reads from the accelerometer and updates the local XYZ variables. Returns 1 for new data and 0 for no new data | |
| Return | |
Read_N_Registers
SimSetXYZ
| SimSetXYZ | |
| Allows the XYZ slider values to be set via the simulation | |
| X | |
| Y | |
| Z | |
| Return | |
Initialise
| Initialise | |
| Sets up up the communication bus and initialises the accelerometer module. Returns 0 for success and > 0 for fail. | |
| Return | |