display bme280 data on 16x2 character lcd display

Dependencies:   mbed TextLCD BME280

Revision:
4:65f98aac8e5d
Parent:
0:2c9585cecfde
--- a/main.cpp	Fri Jun 26 06:42:06 2015 +0000
+++ b/main.cpp	Mon Mar 30 12:40:13 2020 +0000
@@ -1,5 +1,6 @@
 #include "mbed.h"
 #include "BME280.h"
+#include "TextLCD.h"
 
 Serial pc(USBTX, USBRX);
 
@@ -9,10 +10,13 @@
 BME280 sensor(I2C_SDA, I2C_SCL);
 #endif
 
+TextLCD lcd(p10, p12, p15, p16, p29, p30); // rs, rw, e, d4, d5, d6, d7
+
 int main() {
-    
+    sensor.initialize();
     while(1) {
-        pc.printf("%2.2f degC, %04.2f hPa, %2.2f %%\n", sensor.getTemperature(), sensor.getPressure(), sensor.getHumidity());
+        lcd.cls();
+        lcd.printf("%2.2f degC, %04.2f hPa, %2.2f %%\n", sensor.getTemperature(), sensor.getPressure(), sensor.getHumidity());
         wait(1);
     }
 }