HDC1000 sample

Dependencies:   AQM0802 HDC1000 mbed

See http://developer.mbed.org/users/yasuyuki/notebook/HDC1000/

Files at this revision

API Documentation at this revision

Comitter:
yasuyuki
Date:
Wed Jan 28 08:56:47 2015 +0000
Child:
1:f390dfd1f4d5
Commit message:
release

Changed in this revision

AQM0802.lib Show annotated file Show diff for this revision Revisions of this file
HDC1000.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/AQM0802.lib	Wed Jan 28 08:56:47 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/yasuyuki/code/AQM0802/#6fa303916aa8
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HDC1000.lib	Wed Jan 28 08:56:47 2015 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/yasuyuki/code/HDC1000/#82c214412005
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jan 28 08:56:47 2015 +0000
@@ -0,0 +1,53 @@
+//**********************
+// Hygrometer and Thermometer for mbed
+//
+// LPC1768 flash=512KB, ADC=12bits
+// LPC11U35 flash=64KB, ADC=10bits
+// Nucleo ADC=12bits
+//
+// (C)Copyright 2015 All rights reserved by Y.Onodera
+// http://einstlab.web.fc2.com
+//**********************
+#include "mbed.h"
+#include "AQM0802.h"
+#include "HDC1000.h"
+
+#if defined(TARGET_LPC1768)
+I2C i2c(p28,p27);
+#endif
+// for TG-LPC11U35-501
+#if defined(TARGET_LPC11U35_501)
+I2C i2c(P0_5,P0_4);
+#endif
+// for Nucleo
+#if defined(TARGET_NUCLEO_F401RE)
+I2C i2c(D14,D15);
+#endif
+
+AQM0802 lcd(i2c);
+HDC1000 hdc1000(i2c);
+
+int main() {
+    
+    char msg[10];
+    float h;
+    float t;
+      
+    while(1) {
+
+        h = hdc1000.humidity();
+        h = h/0x10000*100;
+        sprintf(msg,"%4.1f%% ",h);
+        lcd.locate(0,0);
+        lcd.print(msg);
+
+        t = hdc1000.temperature();
+        t = t/0x10000*165-40;
+        sprintf(msg,"%4.1fC ",t);
+        lcd.locate(0,1);
+        lcd.print(msg);
+
+        wait(1);
+    }
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jan 28 08:56:47 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5
\ No newline at end of file