Raziel Lopez
/
FRDM-KL46Z_DTH_TEST
Based on another DHT library, this is just a modified one without using the RTC component
Revision 3:8c402316ce7e, committed 2019-01-06
- Comitter:
- RazielLopez
- Date:
- Sun Jan 06 03:08:10 2019 +0000
- Parent:
- 2:ce7b80e0bb2e
- Commit message:
- Agregando mejoras a la libreria original
Changed in this revision
DHT/DHT.cpp | 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 |
--- a/DHT/DHT.cpp Thu Dec 27 21:38:08 2018 +0000 +++ b/DHT/DHT.cpp Sun Jan 06 03:08:10 2019 +0000 @@ -104,25 +104,6 @@ DHT_io = 1; BuildRxBytes(bitTimes); - /*for (i = 0; i < 5; i++) { - b = 0; - for (j = 0; j< 8; j++) { - if ( bitTimes[ i*8+j+1 ] > 0) { - b |= ( 1 << (7-j)); - } - } - DHT_data[i]=b; - }*/ - - /*if (DHT_data[4] == ((DHT_data[0] + DHT_data[1] + DHT_data[2] + DHT_data[3]) & 0xFF)) { - _lastReadTime = currentTime; - _lastTemperature = CalcTemperature(); - _lastHumidity = CalcHumidity(); - - } else { - err = ERROR_CHECKSUM; - }*/ - if(ValidCheckSum()){ _lastReadTime = currentTime; }
--- a/main.cpp Thu Dec 27 21:38:08 2018 +0000 +++ b/main.cpp Sun Jan 06 03:08:10 2019 +0000 @@ -22,7 +22,9 @@ Terminal.printf("\rReading DHT ... "); error_code = dht.readData(); if (error_code){ - Terminal.printf("\r\nError Code: %d \r\n", error_code); + Terminal.printf("\r\nError Code: %d \r\n", error_code); + Terminal.printf("\r\n"); + Terminal.printf("\r\nData: %d %d %d %d %d \v\v\v\v", dht.DHT_data[0], dht.DHT_data[1],dht.DHT_data[2], dht.DHT_data[3], dht.DHT_data[4]); } else{