dht22 libraray for f411
Fork of DHT22 by
Revision 1:0e56fa91f397, committed 2018-01-02
- Comitter:
- chanmei
- Date:
- Tue Jan 02 08:32:00 2018 +0000
- Parent:
- 0:7fd3ff04ae95
- Commit message:
- commit
Changed in this revision
DHT22.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 7fd3ff04ae95 -r 0e56fa91f397 DHT22.cpp --- a/DHT22.cpp Thu Oct 27 15:11:06 2011 +0000 +++ b/DHT22.cpp Tue Jan 02 08:32:00 2018 +0000 @@ -16,14 +16,17 @@ bool DHT22::sample() { DigitalInOut DHT22(_data_pin); int dht22_dat [5]; + DHT22.output(); DHT22.write(0); wait_ms(18); + DHT22.write(1); DHT22.input(); wait_us(40); wait_us(80); int i,j,result=0; + for (i=0; i<5; i++) { result=0; for (j=0; j<8; j++) {