Adafruit FXAS21002C Gyroscope Library
Classes | Macros | Typedefs | Enumerations
Adafruit_FXAS21002C.h File Reference
#include "WProgram.h"
#include <Adafruit_Sensor.h>
#include <Wire.h>

Go to the source code of this file.

Classes

struct  gyroRawData_s
 
class  Adafruit_FXAS21002C
 Unified sensor driver for the Adafruit FXAS21002C breakout. More...
 

Macros

#define FXAS21002C_ID   (0xD7)
 
#define GYRO_SENSITIVITY_250DPS   (0.0078125F)
 
#define GYRO_SENSITIVITY_500DPS   (0.015625F)
 
#define GYRO_SENSITIVITY_1000DPS   (0.03125F)
 
#define GYRO_SENSITIVITY_2000DPS   (0.0625F)
 

Typedefs

typedef struct gyroRawData_s gyroRawData_t
 

Enumerations

enum  gyroRegisters_t {
  GYRO_REGISTER_STATUS = 0x00, GYRO_REGISTER_OUT_X_MSB = 0x01, GYRO_REGISTER_OUT_X_LSB = 0x02, GYRO_REGISTER_OUT_Y_MSB = 0x03,
  GYRO_REGISTER_OUT_Y_LSB = 0x04, GYRO_REGISTER_OUT_Z_MSB = 0x05, GYRO_REGISTER_OUT_Z_LSB = 0x06, GYRO_REGISTER_WHO_AM_I,
  GYRO_REGISTER_CTRL_REG0, GYRO_REGISTER_CTRL_REG1, GYRO_REGISTER_CTRL_REG2
}
 
enum  gyroRange_t { GYRO_RANGE_250DPS = 250, GYRO_RANGE_500DPS = 500, GYRO_RANGE_1000DPS = 1000, GYRO_RANGE_2000DPS = 2000 }
 

Detailed Description

This is part of Adafruit's FXAS21002C driver for the Arduino platform. It is designed specifically to work with the Adafruit FXAS21002C breakout: https://www.adafruit.com/products/3463

These sensors use I2C to communicate, 2 pins (SCL+SDA) are required to interface with the breakout.

Adafruit invests time and resources providing this open source code, please support Adafruit and open-source hardware by purchasing products from Adafruit!

Written by Kevin "KTOWN" Townsend for Adafruit Industries.

MIT license, all text here must be included in any redistribution.

Macro Definition Documentation

◆ FXAS21002C_ID

#define FXAS21002C_ID   (0xD7)

7-bit address for this sensor Device ID for this sensor (used as a sanity check during init)

◆ GYRO_SENSITIVITY_250DPS

#define GYRO_SENSITIVITY_250DPS   (0.0078125F)

Gyroscope sensitivity at 250dps

◆ GYRO_SENSITIVITY_500DPS

#define GYRO_SENSITIVITY_500DPS   (0.015625F)

Gyroscope sensitivity at 500dps

◆ GYRO_SENSITIVITY_1000DPS

#define GYRO_SENSITIVITY_1000DPS   (0.03125F)

Gyroscope sensitivity at 1000dps

◆ GYRO_SENSITIVITY_2000DPS

#define GYRO_SENSITIVITY_2000DPS   (0.0625F)

Gyroscope sensitivity at 2000dps

Typedef Documentation

◆ gyroRawData_t

typedef struct gyroRawData_s gyroRawData_t

Struct to store a single raw (integer-based) gyroscope vector

Enumeration Type Documentation

◆ gyroRegisters_t

Raw register addresses used to communicate with the sensor.

Enumerator
GYRO_REGISTER_STATUS 

0x00

GYRO_REGISTER_OUT_X_MSB 

0x01

GYRO_REGISTER_OUT_X_LSB 

0x02

GYRO_REGISTER_OUT_Y_MSB 

0x03

GYRO_REGISTER_OUT_Y_LSB 

0x04

GYRO_REGISTER_OUT_Z_MSB 

0x05

GYRO_REGISTER_OUT_Z_LSB 

0x06

GYRO_REGISTER_WHO_AM_I 

0x0C (default value = 0b11010111, read only)

GYRO_REGISTER_CTRL_REG0 

0x0D (default value = 0b00000000, read/write)

GYRO_REGISTER_CTRL_REG1 

0x13 (default value = 0b00000000, read/write)

GYRO_REGISTER_CTRL_REG2 

0x14 (default value = 0b00000000, read/write)

◆ gyroRange_t

Enum to define valid gyroscope range values

Enumerator
GYRO_RANGE_250DPS 

250dps

GYRO_RANGE_500DPS 

500dps

GYRO_RANGE_1000DPS 

1000dps

GYRO_RANGE_2000DPS 

2000dps