Fork from Mark Randall MPL3115A2 Altitude/Pressure Sensor. Changed to make it compatible with TiltyQuad TiltyIMU module. By Ian HUA 2014.

Fork of MPL3115A2 by Mark Randall

Revision:
0:67dffed9369b
Child:
1:8e57853ce55b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MPL3115A2.h	Fri Aug 16 13:18:19 2013 +0000
@@ -0,0 +1,31 @@
+#ifndef MBED_MPL3115A2_H
+#define MBED_MPL3115A2_H
+ 
+#include "mbed.h"
+
+#define OFFSET 63  //Set for location this is the Altitude offset in meters
+
+ 
+class MPL3115A2 {
+public:
+    MPL3115A2(int SlaveAddress, PinName pin1, PinName pin2, PinName pin3, PinName pin4);
+	  int Write_Register (char regnum, char data);
+		int Read_Altitude_Data();
+		bool get_int1 ();
+		bool get_int2 ();
+	  float Temp_F ();
+	  float Temp_C ();
+	  float Altitude_ft ();
+	  float Altitude_m ();
+	  int   Init ();
+  
+
+private:
+	I2C _i2c;	
+	DigitalIn _pin1;
+	DigitalIn _pin2;
+
+};
+
+ 
+#endif