Mathieu Moneyron / Mbed 2 deprecated projetS1

Dependencies:   HP206C mbed HMC5883L DHT DS1820

Revision:
49:b1ac7ebb715f
Parent:
48:824fda6804f1
Child:
52:d49b6f468b97
--- a/main.cpp	Tue Oct 02 13:51:25 2018 +0000
+++ b/main.cpp	Mon Oct 08 08:44:16 2018 +0000
@@ -2,19 +2,15 @@
 #include "config.h"
 #include "communication.h"
 #include "T_H_air.h"
-#include "ssd1306.h"
-#include "standard_font.h"
-#include "bold_font.h"
+#include "altitude.h"
+
 
 Serial wisol(SERIAL_PORT);
+Serial pc(USBTX, USBRX);
 DHT sensor(PIN_NAME, DHTtype);
-SSD1306 screen(D11, D9, D13, A4, D2);
+I2C hp206c(D12, A6);
 
 int main() {
-    screen.initialise();
-    screen.clear();
-    screen.set_contrast(255); // max contrast
-    screen.set_font(bold_font, 6);
     while(1) {
         float airH, airT;
         char *message;
@@ -28,12 +24,14 @@
         m = genMessage(T_air, H_air, T_sol, H_sol, Pressure, Mag)
         sendMessage(m)
         */
-        //airH = airHumidity(sensor);
-        //airT = airTemperature(sensor);
+        airH = airHumidity(sensor);
+        airT = airTemperature(sensor);
         //message = genMessage(airT, airH);
         //wisol.printf("AT$SF=%s\r\n", message);
-        screen.printf("test");
-        screen.update();
-        wait(WAIT_TIME);
+        unsigned long alt = readAltitude(&hp206c);
+        pc.printf("H air : %f\n", airH);
+        pc.printf("T air : %f\n", airT);
+        pc.printf("altitude : %lu\n", alt);
+        wait(1);
     }
 }