Unified sensor driver for the Adafruit FXAS21002C breakout.
More...
#include <Adafruit_FXAS21002C.h>
|
Adafruit_I2CDevice * | i2c_dev = NULL |
| Pointer to I2C bus interface.
|
|
Unified sensor driver for the Adafruit FXAS21002C breakout.
◆ Adafruit_FXAS21002C()
Adafruit_FXAS21002C::Adafruit_FXAS21002C |
( |
int32_t |
sensorID = -1 | ) |
|
Instantiates a new Adafruit_FXAS21002C class, including assigning a unique ID to the gyroscope for logging purposes.
- Parameters
-
sensorID | The unique ID to associate with the gyroscope. |
◆ begin()
bool Adafruit_FXAS21002C::begin |
( |
uint8_t |
addr = 0x21 , |
|
|
TwoWire * |
wire = &Wire |
|
) |
| |
Setup the HW.
- Parameters
-
addr | The I2C address of the sensor. |
wire | Pointer to Wire instance |
- Returns
- True if the device was successfully initialized, otherwise false.
◆ getEvent()
bool Adafruit_FXAS21002C::getEvent |
( |
sensors_event_t * |
event | ) |
|
Gets the most recent sensor event.
- Parameters
-
[out] | event | A reference to the sensors_event_t instances where the accelerometer data should be written. |
- Returns
- True if the event was successfully read, otherwise false.
◆ getSensor()
void Adafruit_FXAS21002C::getSensor |
( |
sensor_t * |
sensor | ) |
|
Gets the sensor_t data.
- Parameters
-
[out] | sensor | A reference to the sensor_t instances where the gyroscope sensor info should be written. |
◆ standby()
void Adafruit_FXAS21002C::standby |
( |
boolean |
standby | ) |
|
Puts device into/out of standby mode.
- Parameters
-
standby | Whether we want to go into standby! |
◆ setRange()
void Adafruit_FXAS21002C::setRange |
( |
gyroRange_t |
range | ) |
|
Set the gyroscope full scale range.
- Parameters
-
range | gyroscope full scale range |
◆ setODR()
void Adafruit_FXAS21002C::setODR |
( |
float |
ODR | ) |
|
Configures the device with certain output data rate(ODR) Supports ODRs: 800.0Hz, 400.0Hz, 200.0Hz, 100.0Hz, 50.0Hz, 25.0Hz, 12.5Hz.
- Parameters
-
ODR | : the output data rate to be set to the gyroscope |
◆ getRange()
Get the gyroscope full scale range.
- Returns
- gyroscope full scale range
◆ getODR()
float Adafruit_FXAS21002C::getODR |
( |
| ) |
|
Obtain the current output data rate(ODR) from the gyroscope's register.
- Returns
- The Output Data Rate(ODR) in Hz
The documentation for this class was generated from the following files: