For L3G4200D and L3GD20
L3GD20 3-axis Gyroscope Module
LSM303DLHC+L3GD20 9DOF sensor module
vector g
- The last values read from the gyro.
bool init(byte device, byte sa0)
- Initializes the library with the device being used (L3G4200D or L3GD20) and the state of the SA0 (slave address least significant bit) pin. Constants for these arguments are defined in L3G.h. Both of these arguments are optional; if they are not specified, the library will try to automatically detect the device and slave address, and it will return a boolean indicating whether the autodetection was succesful.
void enableDefault(void)
- Turns on the gyro in the default configuration.
void writeReg(byte reg, byte value)
- Writes a gyro register with the given value. Register address constants are defined in L3G.h.
byte readReg(byte reg)
- Reads a gyro register and returns the value read.
void read(void)
- Takes a reading from the gyro and stores the values in the vector
g
.