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.
Dependencies: BME280 SB1602E mbed
Revision 0:4b63426935b8, committed 2015-04-07
- Comitter:
- MACRUM
- Date:
- Tue Apr 07 05:06:28 2015 +0000
- Child:
- 1:29fb6e4defc8
- Commit message:
- BME280 example code
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/BME280.lib Tue Apr 07 05:06:28 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/MACRUM/code/BME280/#763a4018aaec
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SB1602E.lib Tue Apr 07 05:06:28 2015 +0000 @@ -0,0 +1,1 @@ +http://developer.mbed.org/users/MACRUM/code/SB1602E/#baf578069dfc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Apr 07 05:06:28 2015 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+#include "SB1602E.h"
+#include "BME280.h"
+
+SB1602E lcd(I2C_SDA, I2C_SCL);
+BME280 sensor(I2C_SDA, I2C_SCL);
+DigitalIn btn(dp15);
+
+int main()
+{
+ lcd.setCharsInLine(8);
+ lcd.contrast(0x30);
+ int last_mode = 0;
+ btn.mode(PullUp);
+
+ lcd.printf(0, 0, "BME280");
+ lcd.printf(0, 1, "Demo");
+ wait(5);
+
+ while(1) {
+ if (btn == 1) {
+ if (last_mode == 0)
+ lcd.clear();
+ lcd.printf(0, 0, "%2.2f%cC", sensor.getTemperature(), 0xdf);
+ lcd.printf(0, 1, "%2.2f%%", sensor.getHumidity());
+ last_mode = 1;
+ }
+ else {
+ if (last_mode == 1)
+ lcd.clear();
+ lcd.printf(0, 0, "%2.2f%cC", sensor.getTemperature(), 0xdf);
+ lcd.printf(0, 1, "%04.1fhPa", sensor.getPressure());
+ last_mode = 0;
+ }
+ wait(1);
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Apr 07 05:06:28 2015 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/487b796308b0 \ No newline at end of file