Unified sensor driver for the accelerometer.
More...
#include <Adafruit_LSM303_Accel.h>
Unified sensor driver for the accelerometer.
◆ Adafruit_LSM303_Accel_Unified()
Adafruit_LSM303_Accel_Unified::Adafruit_LSM303_Accel_Unified |
( |
int32_t |
sensorID = -1 | ) |
|
Instantiates a new Adafruit_LSM303 class.
- Parameters
-
sensorID | an optional identifier for the sensor instance |
◆ begin()
bool Adafruit_LSM303_Accel_Unified::begin |
( |
uint8_t |
i2c_address = LSM303_ADDRESS_ACCEL , |
|
|
TwoWire * |
wire = &Wire |
|
) |
| |
Sets up the hardware and initializes I2C.
- Parameters
-
i2c_address | The I2C address to be used. |
wire | The Wire object to be used for I2C connections. |
- Returns
- True if initialization was successful, otherwise false.
◆ getEvent()
bool Adafruit_LSM303_Accel_Unified::getEvent |
( |
sensors_event_t * |
event | ) |
|
Gets the most recent sensor event, Adafruit Unified Sensor format.
- Parameters
-
event | Pointer to an Adafruit Unified sensor_event_t object that we'll fill in |
- Returns
- True on successful read
◆ setRange()
Sets the accelerometer's range.
- Parameters
-
new_range | an lsm303_accel_range_t representing the range of measurements in +/-G. The smaller the range, the more accurate. |
◆ getRange()
Gets the accelerometer's range.
- Returns
- The
lsm303_accel_range_t
representing the range of measurements in +/-G.
◆ getMode()
Get the accelerometer's power mode.
- Returns
- The
lsm303_accel_mode_t
representing the power mode.
◆ setMode()
Sets the accelerometer's power mode.
- Parameters
-
new_mode | an lsm303_accel_mode_t representing the power mode. The mode effects the precision of the sensor's readings High resolution is 12-bit Normal mode is 10-bit Low power is 8-bit |
◆ interruptsActiveHigh()
void Adafruit_LSM303_Accel_Unified::interruptsActiveHigh |
( |
bool |
active_high | ) |
|
Sets the polarity of the interrupt pins.
- Parameters
-
active_high | Set to true for the INT pints to be active high, false for active low |
The documentation for this class was generated from the following files: