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.
Dependencies: C12832 LM75B MPL3115A2 mbed
main.cpp
00001 #include "mbed.h" 00002 #include "LM75B.h" 00003 #include "MSS.h" 00004 #include "MPL3115A2.h" 00005 #define MPL3115A2_I2C_ADDRESS (0x60) 00006 00007 Serial pc(USBTX,USBRX); 00008 00009 //#include "C12832.h" 00010 //C12832 lcd(p5, p7, p6, p8, p11); 00011 //LM75B sensor(p9,p10); 00012 MPL3115A2 mpl(PIN_SDA, PIN_SCL, MPL3115A2_I2C_ADDRESS) ; 00013 00014 int main() { 00015 double alt, bar, temp ; 00016 unsigned char xy; 00017 printf("Bonjour\r\n"); 00018 00019 mpl.setBarIn((unsigned short)(101300/2)); 00020 mpl.activate(); 00021 xy=mpl.getID(); 00022 printf("mouche = %x\r\n",xy); 00023 // sensor.open(); 00024 00025 while(1) { 00026 alt = mpl.getAltitude() ; 00027 bar = mpl.getPressure() ; 00028 temp = mpl.getTemperature() ; 00029 /* lcd.cls(); 00030 lcd.locate(0,1); 00031 lcd.printf("ALTI, BAR, TEMP") ; 00032 lcd.locate(0,10);*/ 00033 printf("%5.2f, %5.2f, %5.2f\r\n",alt, bar, temp) ; 00034 wait(1) ; 00035 } 00036 }
Generated on Sat Sep 10 2022 09:38:53 by
1.7.2