k.j

Dependents:   6DoF_IMU_readvalue_thingy 10dof

Fork of ITG3200 by Uwe Gartmann

Files at this revision

API Documentation at this revision

Comitter:
Vigneshwar
Date:
Wed Feb 05 22:12:01 2014 +0000
Parent:
0:8967cbe04d96
Commit message:
for neil;

Changed in this revision

ITG3200.cpp Show annotated file Show diff for this revision Revisions of this file
ITG3200.h Show annotated file Show diff for this revision Revisions of this file
diff -r 8967cbe04d96 -r de82c71cfc08 ITG3200.cpp
--- a/ITG3200.cpp	Fri Oct 07 21:08:25 2011 +0000
+++ b/ITG3200.cpp	Wed Feb 05 22:12:01 2014 +0000
@@ -211,7 +211,7 @@
     
 }
 
-int ITG3200::getGyroX(void){
+short int ITG3200::getGyroX(void){
 
     char tx = GYRO_XOUT_H_REG;
     char rx[2];
@@ -220,13 +220,13 @@
     
     i2c_.read((ITG3200_I2C_ADDRESS << 1) | 0x01, rx, 2);
     
-    int16_t output = ((int) rx[0] << 8) | ((int) rx[1]);
+    int16_t output = ((short int) rx[0] << 8) | ((short int) rx[1]);
 
     return output;
 
 }
 
-int ITG3200::getGyroY(void){
+short int ITG3200::getGyroY(void){
 
     char tx = GYRO_YOUT_H_REG;
     char rx[2];
@@ -235,13 +235,13 @@
     
     i2c_.read((ITG3200_I2C_ADDRESS << 1) | 0x01, rx, 2);
     
-    int16_t output = ((int) rx[0] << 8) | ((int) rx[1]);
+    int16_t output = ((short int) rx[0] << 8) | ((short int) rx[1]);
 
     return output;
 
 }
 
-int ITG3200::getGyroZ(void){
+short int ITG3200::getGyroZ(void){
 
     char tx = GYRO_ZOUT_H_REG;
     char rx[2];
@@ -250,7 +250,7 @@
     
     i2c_.read((ITG3200_I2C_ADDRESS << 1) | 0x01, rx, 2);
     
-    int16_t output = ((int) rx[0] << 8) | ((int) rx[1]);
+    int16_t output = ((short int) rx[0] << 8) | ((short int) rx[1]);
 
     return output;
     
diff -r 8967cbe04d96 -r de82c71cfc08 ITG3200.h
--- a/ITG3200.h	Fri Oct 07 21:08:25 2011 +0000
+++ b/ITG3200.h	Wed Feb 05 22:12:01 2014 +0000
@@ -237,7 +237,7 @@
      *
      * @return The output on the x-axis in raw ADC counts.
      */
-    int getGyroX(void);
+    short int getGyroX(void);
 
     /**
      * Get the output for the y-axis gyroscope.
@@ -246,7 +246,7 @@
      *
      * @return The output on the y-axis in raw ADC counts.
      */
-    int getGyroY(void);
+    short int getGyroY(void);
 
     /**
      * Get the output on the z-axis gyroscope.
@@ -255,7 +255,7 @@
      * 
      * @return The output on the z-axis in raw ADC counts.
      */
-    int getGyroZ(void);
+    short int getGyroZ(void);
 
     /**
      * Get the power management configuration.