Example using DHT11 with KL05Z. DHT library from teams/components/code/DHT
Diff: main.cpp
- Revision:
- 1:d2396e83a3b9
- Parent:
- 0:052ced68c756
--- a/main.cpp Wed Aug 13 13:44:15 2014 +0000
+++ b/main.cpp Sat Aug 16 11:33:44 2014 +0000
@@ -12,7 +12,7 @@
wait(1); // wait 1 sec for device stable
while (true) {
- myled = 1;
+ myled = 0; // 0: on
err = sensor.readData();
if (err == 0) {
pc.printf("Temperature is %4.2f C \r\n", sensor.ReadTemperature(CELCIUS));
@@ -24,7 +24,7 @@
else {
printf("\r\nErr %i \n", err);
}
- myled = 0;
+ myled = 1;
wait(15);
}
}
S. Ken San