Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
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 }
Generated on Tue Jul 12 2022 22:54:20 by
1.7.2
MPL115A2 - Barometer and temperature sensor