Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 0:aa05800d8feb
--- /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