test program for MPL3115A2

Dependencies:   C12832 LM75B MPL3115A2 mbed

Files at this revision

API Documentation at this revision

Comitter:
bouaziz
Date:
Sat Sep 10 09:38:16 2022 +0000
Parent:
2:ef315a40af7b
Commit message:
test circuit altimetre

Changed in this revision

MPL3115A2.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/MPL3115A2.lib	Wed Nov 22 09:27:32 2017 +0000
+++ b/MPL3115A2.lib	Sat Sep 10 09:38:16 2022 +0000
@@ -1,1 +1,1 @@
-https://mbed.org/teams/MSS/code/MPL3115A2/#12223b4c88b1
+https://mbed.org/teams/MSS/code/MPL3115A2/#0a4af6ebd0fa
--- a/main.cpp	Wed Nov 22 09:27:32 2017 +0000
+++ b/main.cpp	Sat Sep 10 09:38:16 2022 +0000
@@ -6,26 +6,31 @@
 
 Serial pc(USBTX,USBRX);
 
-#include "C12832.h"
-C12832 lcd(p5, p7, p6, p8, p11);
-LM75B sensor(p28,p27);
+//#include "C12832.h"
+//C12832 lcd(p5, p7, p6, p8, p11);
+//LM75B sensor(p9,p10);
 MPL3115A2 mpl(PIN_SDA, PIN_SCL, MPL3115A2_I2C_ADDRESS) ;
 
 int main() {
     double alt, bar, temp ;
-    mpl.setBarIn((unsigned short)(101800/2));
+    unsigned char xy;
+    printf("Bonjour\r\n");
     
-    sensor.open();
+    mpl.setBarIn((unsigned short)(101300/2));
+    mpl.activate();
+    xy=mpl.getID();
+    printf("mouche = %x\r\n",xy);
+ //   sensor.open();
     
     while(1) {
         alt = mpl.getAltitude() ;
         bar = mpl.getPressure() ;
         temp = mpl.getTemperature() ;
-        lcd.cls();
+ /*       lcd.cls();
         lcd.locate(0,1);
-        lcd.printf("ALTI,    BAR,  TEMP",alt, bar, temp) ;
-        lcd.locate(0,10);
-        lcd.printf("%5.2f, %5.2f, %5.2f %5.3f",alt, bar, temp,sensor.temp()) ;
+        lcd.printf("ALTI,    BAR,  TEMP") ;
+        lcd.locate(0,10);*/
+        printf("%5.2f, %5.2f, %5.2f\r\n",alt, bar, temp) ;
         wait(1) ;
     }
 }