Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of ITG3200 by
Diff: ITG3200.cpp
- Revision:
- 4:155c44407af5
- Parent:
- 3:eea9733ca427
- Child:
- 5:0a0315f0f34e
diff -r eea9733ca427 -r 155c44407af5 ITG3200.cpp --- a/ITG3200.cpp Wed Sep 12 14:37:34 2012 +0000 +++ b/ITG3200.cpp Wed Sep 12 15:23:29 2012 +0000 @@ -1,4 +1,5 @@ /** + * @file ITG3200.cpp * @author Aaron Berk * * @section LICENSE @@ -195,9 +196,9 @@ } -int ITG3200::getRawTemperature(void){ +int ITG3200::getWord(int regi){ - char tx = TEMP_OUT_H_REG; + char tx = regi; char rx[2]; i2c_.write(I2C_ADDRESS, &tx, 1); @@ -220,51 +221,6 @@ } -int ITG3200::getGyroX(void){ - - char tx = GYRO_XOUT_H_REG; - char rx[2]; - - i2c_.write((ITG3200_I2C_ADDRESS << 1) & 0xFE, &tx, 1); - - i2c_.read((ITG3200_I2C_ADDRESS << 1) | 0x01, rx, 2); - - int16_t output = ((int) rx[0] << 8) | ((int) rx[1]); - - return output; - -} - -int ITG3200::getGyroY(void){ - - char tx = GYRO_YOUT_H_REG; - char rx[2]; - - i2c_.write((ITG3200_I2C_ADDRESS << 1) & 0xFE, &tx, 1); - - i2c_.read((ITG3200_I2C_ADDRESS << 1) | 0x01, rx, 2); - - int16_t output = ((int) rx[0] << 8) | ((int) rx[1]); - - return output; - -} - -int ITG3200::getGyroZ(void){ - - char tx = GYRO_ZOUT_H_REG; - char rx[2]; - - i2c_.write((ITG3200_I2C_ADDRESS << 1) & 0xFE, &tx, 1); - - i2c_.read((ITG3200_I2C_ADDRESS << 1) | 0x01, rx, 2); - - int16_t output = ((int) rx[0] << 8) | ((int) rx[1]); - - return output; - -} - void ITG3200::getRawGyroXYZ(int readings[3]){ char tx = GYRO_XOUT_H_REG;