c
Diff: GY80.h
- Revision:
- 2:2553ca95fba0
- Parent:
- 1:6909d797972f
- Child:
- 4:cc026f60357a
--- a/GY80.h Sat Oct 05 02:22:15 2013 +0000 +++ b/GY80.h Sun Oct 06 07:09:50 2013 +0000 @@ -3,8 +3,8 @@ #include "mbed.h" #define I2C_FREQ 400000 -//#define SCL PTC8 -//#define SDA PTC9 +#define SCL PTC8 +#define SDA PTC9 #define ACCEL_ADDRESS (0xA6) // 0x53 = 0xA6 / 2 #define MAGN_ADDRESS (0x3C) // 0x1E = 0x3C / 2 @@ -70,20 +70,21 @@ class GY80 { public: - GY80(PinName sda, PinName scl); - void Read_Accel(float* ); + I2C Wire; + GY80(); + ~GY80(); + void Read_Accel(float* accel_v); void Read_Gyro(float* ); void Read_Magn(float* ); private: - I2C Wire; short accel[3]; short gyro[3]; short mag[3]; void Accel_Init(); void Gyro_Init(); void Magn_Init(); - void Convert(float* value, byte* raw); + void Convert(short* value, byte* raw); };