1

Dependents:   Task_1_BallRidingbot_KeepingStationCatching_layingDown_1230

Fork of MPU9250_SPI by Mu kylong

Revision:
2:f274ea3bced9
Parent:
0:768d2e151834
Child:
3:f4fa24cc247d
diff -r f738165e54f0 -r f274ea3bced9 MPU9250.h
--- a/MPU9250.h	Sat Jun 21 11:55:36 2014 +0000
+++ b/MPU9250.h	Sat Jun 21 12:39:55 2014 +0000
@@ -49,14 +49,15 @@
   public:
     mpu9250_spi(SPI& _spi, PinName _cs);
     unsigned int WriteReg( uint8_t WriteAddr, uint8_t WriteData );
-    void ReadRegs( unsigned int ReadAddr, unsigned int *ReadBuf, unsigned int Bytes );
+    unsigned int ReadReg( uint8_t WriteAddr, uint8_t WriteData );
+    void ReadRegs( uint8_t ReadAddr, uint8_t *ReadBuf, unsigned int Bytes );
 
     bool init(int sample_rate_div,int low_pass_filter);
-    float read_acc(int axis);
-    float read_rot(int axis);
+    void read_acc();
+    void read_rot();
     unsigned int set_gyro_scale(int scale);
     unsigned int set_acc_scale(int scale);
-    int calib_acc(int axis);
+    void calib_acc();
     float read_temp();
     void select();
     void deselect();
@@ -65,6 +66,10 @@
     float acc_divider;
     float gyro_divider;
     
+    int calib_data[3];
+    float gyroscope_data[3];
+    float accelerometer_data[3];
+    
   private:
     PinName _CS_pin;
     PinName _SO_pin;