HeptaSat

Dependencies:   mbed DHT11

Files at this revision

API Documentation at this revision

Comitter:
HeptaSatTraining2019
Date:
Wed Nov 06 18:09:06 2019 +0000
Commit message:

Changed in this revision

DHT11.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
diff -r 000000000000 -r d743365e4ee4 DHT11.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DHT11.lib	Wed Nov 06 18:09:06 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/fossum_13/code/DHT11/#5da6f6de3e42
diff -r 000000000000 -r d743365e4ee4 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Nov 06 18:09:06 2019 +0000
@@ -0,0 +1,17 @@
+#include "mbed.h"
+#include "Dht11.h"
+ 
+Serial pc(USBTX, USBRX);
+Dht11 sensor(p15);
+int temp,humid;
+
+int main() {
+     while(1){
+        sensor.read();
+        temp = sensor.getFahrenheit();
+        humid = sensor.getHumidity();
+        temp = (temp - 32.0)/1.80;    // Fahrenheit --> Celsius
+        pc.printf("T: %d, H: %d\r\n", temp, humid);
+        wait(1.0);
+    }
+}
\ No newline at end of file
diff -r 000000000000 -r d743365e4ee4 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Nov 06 18:09:06 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file