DHT sensor LIB

Dependents:   DHT22tester LASS_LoRa_mbed TestingDHT22sensor_fork1 Test_sensor_DHT22

Fork of DHT by Wim De Roeve

Revision:
2:cd93a537b2e7
Parent:
1:6ddabfde1db6
Child:
3:a106059dae56
diff -r 6ddabfde1db6 -r cd93a537b2e7 DHT.cpp
--- a/DHT.cpp	Fri Feb 05 10:03:57 2016 +0000
+++ b/DHT.cpp	Wed Feb 24 09:07:53 2016 +0000
@@ -43,6 +43,21 @@
 DHT::~DHT() {
 }
 
+void DHT::printErr(int ErrType) {
+ switch (ErrType) {
+   case 0: printf("ERROR_NONE"); break;
+   case 1: printf("BUS_BUSY"); break;
+   case 2: printf("ERROR_NOT_PRESENT"); break;
+   case 3: printf("ERROR_ACK_TOO_LONG"); break;
+   case 4: printf("ERROR_SYNC_TIMEOUT"); break;
+   case 5: printf("ERROR_DATA_TIMEOUT"); break;
+   case 6: printf("ERROR_CHECKSUM"); break;
+   case 7: printf("ERROR_NO_PATIENCE"); break;
+
+ } 
+ printf("\r\n");   
+}    
+
 int DHT::readData() {
     int i, j, retryCount,b;
     unsigned int bitTimes[DHT_DATA_BIT_COUNT];