Difference between revisions of "Component: Accelerometer 3-Axis (LIS3LV02DQ) (Movement Orientation)"
From Flowcode Help
Jump to navigationJump to search| Line 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
| − | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/ | + | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_temp/Accelerometer_LIS3LV0DQ.fcfx FC_Comp_Source_temp/Accelerometer_LIS3LV0DQ.fcfx] |
| − | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/ | + | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_temp/Accelerometer_LIS3LV0DQ.fcfx FC_Comp_Source_temp/Accelerometer_LIS3LV0DQ.fcfx] |
==Detailed description== | ==Detailed description== | ||
| Line 103: | Line 103: | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| + | ==Macro reference== | ||
===CollectXYZData=== | ===CollectXYZData=== | ||
| Line 138: | Line 126: | ||
| − | === | + | ===Initialise=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Sets up up the communication bus and initialises the accelerometer module. Returns 0 for success and > 0 for fail. |
|- | |- | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | ||
| + | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
| + | |} | ||
| + | |||
| + | |||
| + | ===SimReset1G=== | ||
| + | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
| + | |- | ||
| + | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SimReset1G''' | ||
| + | |- | ||
| + | | colspan="2" | Resets the simulation to 0.0 on X and Y and 1.0 on Z as if the accelerometer was sitting completely horizontal. | ||
| + | |- | ||
| + | |- | ||
| + | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | | width="90%" style="border-top: 2px solid #000;" | ''Return'' | ||
|} | |} | ||
| Line 181: | Line 183: | ||
| − | === | + | ===UpdateXYZData=== |
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
|- | |- | ||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | | width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | ||
| − | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | ''' | + | | width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''UpdateXYZData''' |
|- | |- | ||
| − | | colspan="2" | | + | | colspan="2" | Reads from the accelerometer and updates the local XYZ variables. Returns 1 for new data and 0 for no new data |
|- | |- | ||
|- | |- | ||
Revision as of 11:59, 3 February 2023
| Author | Matrix Ltd. |
| Version | 2.0 |
| Category | Movement Orientation |
Contents
Accelerometer 3-Axis (LIS3LV02DQ) component
LIS3LV02DQ Accelerometer sensor with options for I2C or SPI communications. Useful for approximating Pitch and Roll or for detecting acceleration. Also available in the form of the EB068 Accelerometer E-block.
Component Source Code
Please click here to download the component source project: FC_Comp_Source_temp/Accelerometer_LIS3LV0DQ.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_temp/Accelerometer_LIS3LV0DQ.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
CollectXYZData
Error creating thumbnail: Unable to save thumbnail to destination
|
CollectXYZData |
| Collect the data from the local accelerometer buffers. The Axis parameter specifies the Axis to be read. 0 / 'x' / 'X' - X axis 1 / 'y' / 'Y' - Y axis 2 / 'z' / 'Z' - Z axis | |
Error creating thumbnail: Unable to save thumbnail to destination - BYTE
|
Axis |
Error creating thumbnail: Unable to save thumbnail to destination - INT
|
Return |
Initialise
Error creating thumbnail: Unable to save thumbnail to destination
|
Initialise |
| Sets up up the communication bus and initialises the accelerometer module. Returns 0 for success and > 0 for fail. | |
Error creating thumbnail: Unable to save thumbnail to destination - BYTE
|
Return |
SimReset1G
Error creating thumbnail: Unable to save thumbnail to destination
|
SimReset1G |
| Resets the simulation to 0.0 on X and Y and 1.0 on Z as if the accelerometer was sitting completely horizontal. | |
Error creating thumbnail: Unable to save thumbnail to destination - VOID
|
Return |
SimSetXYZ
Error creating thumbnail: Unable to save thumbnail to destination
|
SimSetXYZ |
| Allows the XYZ slider values to be set via the simulation | |
Error creating thumbnail: Unable to save thumbnail to destination - INT
|
X |
Error creating thumbnail: Unable to save thumbnail to destination - INT
|
Y |
Error creating thumbnail: Unable to save thumbnail to destination - INT
|
Z |
Error creating thumbnail: Unable to save thumbnail to destination - VOID
|
Return |
UpdateXYZData
Error creating thumbnail: Unable to save thumbnail to destination
|
UpdateXYZData |
| Reads from the accelerometer and updates the local XYZ variables. Returns 1 for new data and 0 for no new data | |
Error creating thumbnail: Unable to save thumbnail to destination - BYTE
|
Return |
Property reference
Error creating thumbnail: Unable to save thumbnail to destination
|
Properties |
Error creating thumbnail: Unable to save thumbnail to destination
|
Bit Depth |
| The number of binary bits used to store the sensor's X,Y,Z readings. | |
Error creating thumbnail: Unable to save thumbnail to destination
|
Bus Type |
| The interface used to talk to the accelerometer. I2C - Two Wire Interface SDA / SCL SPI - Four Wire Interface MISO / MOSI / SCK / CS | |
Error creating thumbnail: Unable to save thumbnail to destination
|
Data Rate |
| Configures how often the sensor collects a new reading. More often = better instant reaction to new events Less often = more stable results | |
Error creating thumbnail: Unable to save thumbnail to destination
|
Scale |
| The accelerometer readings are scaled based on the maximum amount of G force the sensor can represent. 6G = Bigger gravitational force 2G = Higher resolution | |
Error creating thumbnail: Unable to save thumbnail to destination
|
Int Option |
| Sets if we use the interrupt pin to check if new data is available | |
Error creating thumbnail: Unable to save thumbnail to destination
|
Power Option |
| Sets if the sensor is always powered or powered via a microcontroller output pin. | |
Error creating thumbnail: Unable to save thumbnail to destination
|
Connections |
Error creating thumbnail: Unable to save thumbnail to destination
|
SPI Connections |
Error creating thumbnail: Unable to save thumbnail to destination
|
Channel |
| SPI Channel selector | |
Error creating thumbnail: Unable to save thumbnail to destination
|
Prescale |
| Prescale option selector | |
Error creating thumbnail: Unable to save thumbnail to destination
|
MOSI |
| SPI Data Out Pin SDO - Also Known as Master Out Slave In (MOSI) when used in Master mode. | |
Error creating thumbnail: Unable to save thumbnail to destination
|
MISO |
| SPI Data In Pin SDI - Also Known as Master In Slave Out (MISO) when used in Master mode. | |
Error creating thumbnail: Unable to save thumbnail to destination
|
CLK |
| SPI Clock Pin CLK - The Clock signal is driven by the SPI master. | |
Error creating thumbnail: Unable to save thumbnail to destination
|
CS / SS |
| Chip Select / Slave Select Pin Master Mode: General purpose output pin used to select the remote SPI device. Slave Mode: Hardware chip select pin input used to select the SPI device. | |
Error creating thumbnail: Unable to save thumbnail to destination
|
Simulation |
Error creating thumbnail: Unable to save thumbnail to destination
|
Simulation Coms |
| Yes: Accelerometer data will come from the simulation component sliders. No: Accelerometer data will come from the CAL component - I2C or SPI - API etc | |