Difference between revisions of "Component: Accelerometer (EB068, LIS3LV02DQ) (Sensors)"
(XML import BR) |
|||
Line 7: | Line 7: | ||
|- | |- | ||
| width="20%" style="color: gray;" | Version | | width="20%" style="color: gray;" | Version | ||
− | | 1. | + | | 1.5 (Release) |
|- | |- | ||
| width="20%" style="color: gray;" | Category | | width="20%" style="color: gray;" | Category | ||
Line 21: | Line 21: | ||
==Examples== | ==Examples== | ||
− | |||
Example digital spirit level using the EB068/LIS3LV02DQ sensor and the EBM001 graphical display. | Example digital spirit level using the EB068/LIS3LV02DQ sensor and the EBM001 graphical display. | ||
− | |||
{{Fcfile|DigSpiritLevel.fcfx|DigSpiritLevel}} | {{Fcfile|DigSpiritLevel.fcfx|DigSpiritLevel}} | ||
− | |||
− | |||
[[File:Spirit.jpg]] | [[File:Spirit.jpg]] | ||
− | |||
==Downloadable macro reference== | ==Downloadable macro reference== | ||
Line 154: | Line 149: | ||
a 10ms delay between an I2C stop event and the next I2C start event. | a 10ms delay between an I2C stop event and the next I2C start event. | ||
+ | |||
Line 169: | Line 165: | ||
Less often = more stable results | Less often = more stable results | ||
− | |||
<span style="font-weight: normal;"><u>Scale</u></span> | <span style="font-weight: normal;"><u>Scale</u></span> | ||
Line 215: | Line 210: | ||
This property is of type ''Single digital pin'' and can be referenced with the variable name ''scl_pin''. | This property is of type ''Single digital pin'' and can be referenced with the variable name ''scl_pin''. | ||
− | I2C Serial Clock Pin - SCL | + | I2C Serial Clock Pin - SCL |
Latest revision as of 15:45, 16 February 2017
Author | Matrix Ltd. |
Version | 1.5 (Release) |
Category | Sensors |
Contents
Accelerometer (EB068, 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.
Examples
Example digital spirit level using the EB068/LIS3LV02DQ sensor and the EBM001 graphical display.
DigSpiritLevel
Downloadable macro reference
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
Parameters
- BYTE Axis
Return value
UpdateXYZData
Reads from the accelerometer and updates the local XYZ variables.
Returns 1 for new data and 0 for no new data
Parameters
- This macro has no parameters
Return value
Initialise
Sets up up the communication bus and initialises the accelerometer module.
Returns 0 for success and > 0 for fail.
Parameters
- This macro has no parameters
Return value
Simulation macro reference
SimReset1G
Resets the simulation to 0.0 on X and Y and 1.0 on Z as if the accelerometer was
sitting completely horizontal.
Parameters
- This macro has no parameters
Return value
- This call does not return a value
SimSetXYZ
Allows the XYZ slider values to be set via the simulation
Parameters
- INT X
- INT Y
- INT Z
Return value
- This call does not return a value
Property reference
Bit Depth
This property is of type Signed integer and can be referenced with the variable name bit_depth.
The number of binary bits used to store the sensor's X,Y,Z readings.
Bus Type
This property is of type Fixed list of ints and can be referenced with the variable name bus_type.
The interface used to talk to the accelerometer.
I2C - Two Wire Interface SDA / SCL
SPI - Four Wire Interface MISO / MOSI / SCK / CS
Channel
This property is of type Fixed list of ints and can be referenced with the variable name channel.
Peripheral channel.
Software = Create the channel using software bit banging routines - Any pin
Channel X = Create the channel using a hardware peripheral - Fixed pins
Stop Delay
This property is of type True or false and can be referenced with the variable name StopDel.
On older microcontroller devices there is a potential for the I2C hardware channel to lock up if there is not
a 10ms delay between an I2C stop event and the next I2C start event.
Most modern microcontrollers will not have a problem so this property can be disabled to speed up the
I2C communications.
Data Rate
This property is of type Fixed list of ints and can be referenced with the variable name data_rate.
Configures how often the sensor collects a new reading.
More often = better instant reaction to new events
Less often = more stable results
Scale
This property is of type Fixed list of ints and can be referenced with the variable name 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
Int Option
This property is of type Fixed list of ints and can be referenced with the variable name IntOpt.
Sets if we use the interrupt pin to check if new data is available
Power Option
This property is of type Fixed list of ints and can be referenced with the variable name PowerOpt.
Sets if the sensor is always powered or powered via a microcontroller output pin.
Interrupt Pin
This property is of type Single digital pin and can be referenced with the variable name int_pin.
Interrupt pin from the sensor, checked when performing an update to see if the sensor has new data available.
Power Pin
This property is of type Single digital pin and can be referenced with the variable name pwr_pin.
Power pin if the sensor is powered from an I/O pin.
SDA Pin
This property is of type Single digital pin and can be referenced with the variable name sda_pin.
I2C Serial Data Pin - SDA
SCL Pin
This property is of type Single digital pin and can be referenced with the variable name scl_pin.
I2C Serial Clock Pin - SCL