Adafruit FXAS21002C Gyroscope Library
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Adafruit_FXAS21002C Class Reference

Unified sensor driver for the Adafruit FXAS21002C breakout. More...

#include <Adafruit_FXAS21002C.h>

Inheritance diagram for Adafruit_FXAS21002C:

Public Member Functions

 Adafruit_FXAS21002C (int32_t sensorID=-1)
 Instantiates a new Adafruit_FXAS21002C class, including assigning a unique ID to the gyroscope for logging purposes. More...
 
bool begin (uint8_t addr=0x21, TwoWire *wire=&Wire)
 Setup the HW. More...
 
bool getEvent (sensors_event_t *event)
 Gets the most recent sensor event. More...
 
void getSensor (sensor_t *sensor)
 Gets the sensor_t data. More...
 
void standby (boolean standby)
 Puts device into/out of standby mode. More...
 
void setRange (gyroRange_t range)
 Set the gyroscope full scale range. More...
 
void 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. More...
 
gyroRange_t getRange ()
 Get the gyroscope full scale range. More...
 
float getODR ()
 Obtain the current output data rate(ODR) from the gyroscope's register. More...
 

Public Attributes

gyroRawData_t raw
 Raw gyroscope values from last sensor read.
 

Protected Attributes

Adafruit_I2CDevice * i2c_dev = NULL
 Pointer to I2C bus interface.
 

Detailed Description

Unified sensor driver for the Adafruit FXAS21002C breakout.

Constructor & Destructor Documentation

◆ 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
sensorIDThe unique ID to associate with the gyroscope.

Member Function Documentation

◆ begin()

bool Adafruit_FXAS21002C::begin ( uint8_t  addr = 0x21,
TwoWire *  wire = &Wire 
)

Setup the HW.

Parameters
addrThe I2C address of the sensor.
wirePointer 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]eventA 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]sensorA 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
standbyWhether we want to go into standby!

◆ setRange()

void Adafruit_FXAS21002C::setRange ( gyroRange_t  range)

Set the gyroscope full scale range.

Parameters
rangegyroscope 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()

gyroRange_t Adafruit_FXAS21002C::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: