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: USBDevice idDHTLib mbed
Revision 0:7d6ba98d8088, committed 2014-01-28
- Comitter:
- Njbuch
- Date:
- Tue Jan 28 18:47:50 2014 +0000
- Commit message:
- Test of Arch GPRS with Grove TempHum sensor based on DHT11 with the idDHTLib.
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/USBDevice.lib Tue Jan 28 18:47:50 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/USBDevice/#335f2506f422
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/idDHTLib.lib Tue Jan 28 18:47:50 2014 +0000 @@ -0,0 +1,1 @@ +https://mbed.org/users/kfigiela/code/idDHTLib/#53913db38502
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Tue Jan 28 18:47:50 2014 +0000
@@ -0,0 +1,44 @@
+#include "mbed.h"
+#include "idDHTLib.h"
+#include "USBSerial.h"
+
+DigitalOut myled(LED1);
+//Virtual serial port over USB
+USBSerial serial;
+
+void dhtWrapper();
+idDHTLib DHTLib(P1_24, dhtWrapper);
+
+void dhtWrapper()
+{
+ DHTLib.dht11Callback(); // change do dht11Callback if needed
+}
+
+void readDht()
+{
+ if(!DHTLib.acquiring()) DHTLib.acquire();
+}
+
+int main()
+{
+ float humidity;
+ float temperature;
+ wait(10);
+ serial.printf("\r\nDHT Test program");
+ serial.printf("\r\n******************\r\n");
+ wait(1); // wait 1 second for device stable status
+ DHTLib.acquireAndWait();
+ while (1) {
+ myled = 1;
+ readDht();
+ humidity = DHTLib.getHumidity();
+ temperature = DHTLib.getCelsius();
+ serial.printf("Status is %i\r\n",DHTLib.getStatus());
+ serial.printf("Temperature is %4.2f C \r\n",temperature);
+ serial.printf("Humidity is %4.2f \r\n",humidity);
+
+ myled = 0;
+ wait(10);
+ }
+
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Tue Jan 28 18:47:50 2014 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f \ No newline at end of file