STMicroelectronics LSM303AGR Element
The LSM303AGR element is used to measure acceleration, magnetic forces, and temperature. This element is for using the STMicroelectronics LSM303AGR three-axis linear accelerometer and digital magnetic sensor.
The LSM303AGR is a sensor element that can be imported into the Element Toolbox through the Add Element button located in the toolbox from the Embedded tab. SensorTile projects have this element imported by default.
Properties
The following properties can be changed for the LSM303AGR element:
Name
The name of the element.
Communication Mode
The mode the sensor uses to transmit data: SPI or I2C.
I2C Driver Instance
The I2C bus used to communicate with the sensor.
SPI Driver Instance
The SPI bus used to communicate with the sensor.
GPIO Driver Instance
The GPIO driver instance number to use.
Magnetometer Chip Select Pin
The GPIO pin used for the magnetometer to toggle the chip select pin.
Accelerometer Chip Select Pin
The GPIO pin used for the accelerometer to toggle the chip select pin.
3 Wire SPI Mode
The mode of the sensor’s SPI driver: 3 wire or 4 wire. If 3 wire mode is enabled, the MOSI and MISO wires are combined in half-duplex communication.
Accelerometer I2C Address
The I2C address for the accelerometer the element sends data to.
Magnetometer I2C Address
The I2C address for the magnetometer the element sends data to.
Accel Output Data Rate
The rate of output the accelerometer driver runs at in Hz. This element includes the following data rate options:
Power Off
1 Hz
10 Hz
(default)25 Hz
50 Hz
100 Hz
200 Hz
400 Hz
1.620 kHz Low Power
3.33 kHz Low Power
6.66 kHz
1.6 Hz
Mag Output Data Rate
The rate of output the magnetometer driver runs at in Hz. This element includes the following data rate options:
10 Hz
(default)20 Hz
50 Hz
100 Hz
Accelerometer Full Scale
The accelerometer’s sensitivity to linear acceleration in gs. This element includes the following full scale options:
2 g
(default)4 g
8 g
16 g
Magnetometer Reset Mode
The mode that initiates the magnetometer to reset. This element includes the following reset modes:
Released Every 63 ODR
Offset Cancellation Enabled
Released Only At Power On
Magnetometer Temperature Compensation
The state of the magnetometer’s temperature compensation setting: disabled or enabled.
Accelerometer Operating Mode
The power mode the accelerometer runs at. This element includes the following operating modes:
High Resolution (12 bit)
Normal (10 bit)
Low Power (8 bit)
Magnetometer Operating Mode
The power mode the magnetometer runs at. This element includes the following operating modes:
Continuous Mode
Single Trigger
Power Down
Triggers
The following triggers are available to execute events from within the LSM303AGR element:
Triggered
Execute an event when the source element connected to the LSM303AGR triggers.
X Acceleration Read
Execute an event when the accelerometer’s x-axis value is read.
Y Acceleration Read
Execute an event when the accelerometer’s y-axis value is read.
Z Acceleration Read
Execute an event when the accelerometer’s z-axis value is read.
Acceleration Read
Execute an event when the accelerometer’s data is read.
X Magnetic Field Read
Execute an event when the magnetometer’s x-axis value is read.
Y Magnetic Field Read
Execute an event when the magnetometer’s y-axis value is read.
Z Magnetic Field Read
Execute an event when the magnetometer’s z-axis value is read.
Magnetic Field Read
Execute an event when the magnetometer’s data is read.
Temperature Read
Execute an event when temperature data is read.
Abilities
The following abilities are available for the LSM303AGR element when its source element triggers:
Trigger
Trigger the element(s) that follow the LSM303AGR element.
Read X Acceleration
Read the accelerometer’s x-axis data in mGs.
Read Y Acceleration
Read the accelerometer’s y-axis data.
Read Z Acceleration
Read the accelerometer’s z-axis data.
Read Acceleration
Read the accelerometer’s x-, y-, and z-axis data.
Read X Magnetic Field
Read the magnetometer’s x-axis data in mGa.
Read Y Magnetic Field
Read the magnetometer’s y-axis data.
Read Z Magnetic Field
Read the magnetometer’s z-axis data.
Read Magnetic Field
Read the magnetometer’s x-, y-, and z-axis data.
Read Temperature (°C)
Read the temperature data (in Celsius).