Pololu Zumo Shield Arduino Library
|
Interfaces with the inertial sensors on the Zumo Shield. More...
#include <ZumoIMU.h>
Classes | |
struct | vector |
Represents a 3-dimensional vector with x, y, and z components. More... | |
Public Member Functions | |
uint8_t | getLastError () |
Returns 0 if the last I2C communication with the IMU was successful, or a non-zero status code if there was an error. | |
bool | init () |
Initializes the inertial sensors and detects their type. More... | |
ZumoIMUType | getType () |
Returns the type of the inertial sensors on the Zumo Shield. More... | |
void | enableDefault () |
Enables all of the inertial sensors with a default configuration. | |
void | configureForCompassHeading () |
Configures the sensors with settings optimized for determining a compass heading with the magnetometer. | |
void | writeReg (uint8_t addr, uint8_t reg, uint8_t value) |
Writes an 8-bit sensor register. More... | |
uint8_t | readReg (uint8_t addr, uint8_t reg) |
Reads an 8-bit sensor register. More... | |
void | readAcc () |
Takes a reading from the accelerometer and makes the measurements available in a. | |
void | readGyro () |
Takes a reading from the gyro and makes the measurements available in g. | |
void | readMag () |
Takes a reading from the magnetometer and makes the measurements available in m. | |
void | read () |
Takes a reading from all three sensors (accelerometer, gyro, and magnetometer) and makes their measurements available in the respective vectors. | |
bool | accDataReady () |
Indicates whether the accelerometer has new measurement data ready. More... | |
bool | gyroDataReady () |
Indicates whether the gyro has new measurement data ready. More... | |
bool | magDataReady () |
Indicates whether the magnetometer has new measurement data ready. More... | |
Public Attributes | |
vector< int16_t > | a = {0, 0, 0} |
Raw accelerometer readings. | |
vector< int16_t > | g = {0, 0, 0} |
Raw gyro readings. | |
vector< int16_t > | m = {0, 0, 0} |
Raw magnetometer readings. | |
Interfaces with the inertial sensors on the Zumo Shield.
This class allows you to configure and get readings from the I2C sensors that make up the Zumo Shield's inertial measurement unit (IMU): gyro, accelerometer, and magnetometer.
You must call Wire.start()
before using any of this library's functions that access the sensors.
bool ZumoIMU::accDataReady | ( | ) |
Indicates whether the accelerometer has new measurement data ready.
Definition at line 298 of file ZumoIMU.cpp.
|
inline |
bool ZumoIMU::gyroDataReady | ( | ) |
Indicates whether the gyro has new measurement data ready.
Definition at line 314 of file ZumoIMU.cpp.
bool ZumoIMU::init | ( | ) |
Initializes the inertial sensors and detects their type.
Definition at line 11 of file ZumoIMU.cpp.
bool ZumoIMU::magDataReady | ( | ) |
Indicates whether the magnetometer has new measurement data ready.
Definition at line 327 of file ZumoIMU.cpp.
uint8_t ZumoIMU::readReg | ( | uint8_t | addr, |
uint8_t | reg | ||
) |
Reads an 8-bit sensor register.
addr | Device address. |
reg | Register address. |
Definition at line 205 of file ZumoIMU.cpp.
void ZumoIMU::writeReg | ( | uint8_t | addr, |
uint8_t | reg, | ||
uint8_t | value | ||
) |
Writes an 8-bit sensor register.
addr | Device address. |
reg | Register address. |
value | 8-bit register value to be written. |
Definition at line 197 of file ZumoIMU.cpp.