test program for MPL3115A2
Dependencies: C12832 LM75B MPL3115A2 mbed
Diff: main.cpp
- Revision:
- 3:cb376fbf96dd
- Parent:
- 2:ef315a40af7b
diff -r ef315a40af7b -r cb376fbf96dd main.cpp --- 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) ; } }