MPL115A2
Note
This part has been moved to the components section of the website http://developer.mbed.org/components/MPL115A2/.
MPL115A is a simple barometer with digital output and high performance targeting low cost commercial applications. The device employs a MEMS PRT pressure sensor with a conditioning IC to provide accurate pressure data. The sensor output is accurate to ±1 kPa over the 50 kPa to 115 kPa pressure range. An integrated ADC provides digitized temperature and pressure sensor outputs via an I2C or SPI bus. The part’s operating voltage is from 2.375 V to 5.5 V.
The part is available as either an I2C or SPI part.. However, the library on this page is for the I2C version.
Avaliable as a
Hello World¶
Import program
00001 #include "mbed.h" 00002 #include "MPL115A2.h" 00003 00004 I2C i2c(p9, p10); // sda, scl 00005 Serial pc(USBTX, USBRX); // tx, rx 00006 00007 // MPL115A2 p_sensor(&i2c, &pc); //DEBUG verion 00008 MPL115A2 p_sensor(&i2c); 00009 00010 int main() { 00011 00012 p_sensor.begin(); 00013 00014 while(1) 00015 { 00016 00017 p_sensor.ReadSensor(); 00018 pc.printf("Pressure = %f\n", p_sensor.GetPressure()); 00019 wait(1); 00020 pc.printf("Temperature = %f\n", p_sensor.GetTemperature()); 00021 wait(1); 00022 00023 00024 } 00025 }
Library¶
This library for the MPL115A2
Import librarympl115a2
mpl115A2 i2c pressure and temperature sensor