|
Adafruit FXAS21002C Gyroscope Library
|
#include <Adafruit_BusIO_Register.h>#include <Adafruit_I2CDevice.h>#include <Adafruit_Sensor.h>#include <Arduino.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) |
| #define | GYRO_ODR_800HZ (800.0f) |
| #define | GYRO_ODR_400HZ (400.0f) |
| #define | GYRO_ODR_200HZ (200.0f) |
| #define | GYRO_ODR_100HZ (100.0f) |
| #define | GYRO_ODR_50HZ (50.0f) |
| #define | GYRO_ODR_25HZ (25.0f) |
| #define | GYRO_ODR_12_5HZ (12.5f) |
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 } |
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.
| #define FXAS21002C_ID (0xD7) |
7-bit address for this sensor Device ID for this sensor (used as a sanity check during init)
| #define GYRO_SENSITIVITY_250DPS (0.0078125F) |
Gyroscope sensitivity at 250dps
| #define GYRO_SENSITIVITY_500DPS (0.015625F) |
Gyroscope sensitivity at 500dps
| #define GYRO_SENSITIVITY_1000DPS (0.03125F) |
Gyroscope sensitivity at 1000dps
| #define GYRO_SENSITIVITY_2000DPS (0.0625F) |
Gyroscope sensitivity at 2000dps
| #define GYRO_ODR_800HZ (800.0f) |
Define valid gyroscope output data rate values(ODR)800Hz
| #define GYRO_ODR_400HZ (400.0f) |
400Hz
| #define GYRO_ODR_200HZ (200.0f) |
200Hz
| #define GYRO_ODR_100HZ (100.0f) |
100Hz
| #define GYRO_ODR_50HZ (50.0f) |
50Hz
| #define GYRO_ODR_25HZ (25.0f) |
25Hz
| #define GYRO_ODR_12_5HZ (12.5f) |
12.5Hz
| typedef struct gyroRawData_s gyroRawData_t |
Struct to store a single raw (integer-based) gyroscope vector
| enum gyroRegisters_t |
Raw register addresses used to communicate with the sensor.
| enum gyroRange_t |
1.8.13