ELEC6245 - Wireless Networks / Mbed 2 deprecated C027_BME280

Dependencies:   BME280 mbed

Files at this revision

API Documentation at this revision

Comitter:
maximusismax
Date:
Thu Dec 01 11:19:21 2016 +0000
Commit message:
Simple code

Changed in this revision

BME280.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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BME280.lib	Thu Dec 01 11:19:21 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/MACRUM/code/BME280/#ddcaa259e65b
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Dec 01 11:19:21 2016 +0000
@@ -0,0 +1,29 @@
+#include "mbed.h"
+#include "BME280.h"
+#ifdef TARGET_UBLOX_C027
+ #include "C027_api.h"
+#else
+ #error "This example is targeted for the C027 platform"
+#endif
+
+DigitalOut myled(LED1);
+Serial pc(USBTX, USBRX);
+I2C i2c(P0_0, P0_1);
+BME280 sensor(i2c);
+
+int main() {
+    float temp = 0;
+    float pres = 0;
+    float humid = 0;
+
+        
+    sensor.initialize();
+    while(1) {
+        myled = !myled;
+        wait(0.2);
+        temp = sensor.getTemperature();
+        pres = sensor.getPressure();
+        humid = sensor.getHumidity();
+        pc.printf("temp: %f, pres: %f, humid: %f\n", temp, pres, humid);
+    }    
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Dec 01 11:19:21 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/d75b3fe1f5cb
\ No newline at end of file