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

MPL3115A2.h

Committer:
mr63
Date:
2013-08-16
Revision:
0:67dffed9369b
Child:
1:8e57853ce55b

File content as of revision 0:67dffed9369b:

#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