[PicBasic]DHT22 interface problem

Status
Not open for further replies.

Mazytis

Newbie level 3
Joined
Jul 16, 2015
Messages
4
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
27
Hi, I'm trying to get response from DHT22 sensor with PIC12F675, but something is wrong... Here is my code:
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.
 

what is the time period between high led and low led ?
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…