fix dht.c error: can't read data from DHT 11 #485
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello,
I notice when I use the example
gpio/dht_sensor
in right way, Pico can't read data from DHT11. It toke a night and after reading datasheet https://www.mouser.com/datasheet/2/758/DHT11-Technical-Data-Sheet-Translated-Version-1143054.pdf, I find this error according 2 errors:count
(accumulated time) is 26~28, because 26~28 means data "0", If it is longer, it means data "1". But for redundancy, I choose 35 (I test it works well).This is first time I find this error [Why DHT11 not work after some times using C in pico - Raspberry Pi Forums](https://forums.raspberrypi.com/viewtopic.php?t=355462l), in this post, I use USB and minicom on Mac.
Recently, I buy a Raspberry Pi 4B to re-test this error following the document Raspberry Pi Pico C/C++ SDK by UART, this error still exists. It displays:
The print's dislocation may be according to I ssh to raspberry pi. But the data from DHT11 also are
0
, and printBad data
.After fixing, it displays:
It works well.