DHT22 interface problem


+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    May 2015
    Posts
    7

    Default DHT22 interface problem

    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.
    Last edited by mazytis; - 23rd July 2015 at 22:54.

  2. #2
    Join Date
    Jun 2009
    Location
    Sc*nthorpe, UK
    Posts
    333

    Default Re: DHT22 interface problem


  3. #3
    Join Date
    Jan 2013
    Location
    Texas USA
    Posts
    229

    Default Re: DHT22 interface problem

    You can also look at this thread.
    http://www.picbasic.co.uk/forum/showthread.php?t=19975
    Regards,
    TABSoft

Similar Threads

  1. DHT22, AM2302 and pic18F2320
    By bitmaniac in forum mel PIC BASIC Pro
    Replies: 17
    Last Post: - 15th November 2015, 01:42
  2. dht22 using bit field array and ext references
    By richard in forum Code Examples
    Replies: 4
    Last Post: - 1st April 2015, 04:20
  3. SPI interface
    By malc-c in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 9th January 2011, 02:06
  4. DMX Interface
    By electronicsuk in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 15th July 2005, 14:13
  5. PC interface
    By tigrot in forum Schematics
    Replies: 1
    Last Post: - 9th October 2004, 20:32

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts