PDA

View Full Version : DHT22 interface problem



mazytis
- 23rd July 2015, 21:35
Hi, I'm trying to get response from DHT22 sensor with PIC12F675, but something is wrong... Here is my code:


#CONFIG
__config _HS_OSC & _WDT_OFF & _CP_OFF & _MCLRE_OFF & _BODEN_OFF & _PWRTE_OFF
#ENDCONFIG


DEFINE OSC 4


CMCON = 7 : OPTION_REG.7 = 0
LED var GPIO.2
DHT var GPIO.0
pause 100


output DHT
high DHT
pause 10
low dht
pause 10
high dht
pauseus 40
input dht


while dht = 1
high led : pause 50
low led : pause 50
wend


while dht = 0
high led : pause 50
low led : pause 50
wend


end


By the way, sorry for my English speech.

EarlyBird2
- 24th July 2015, 08:58
look here

http://www.picbasic.co.uk/forum/showthread.php?t=17867

Tabsoft
- 25th July 2015, 03:01
You can also look at this thread.
http://www.picbasic.co.uk/forum/showthread.php?t=19975