Dht11 - 16f877a


Results 1 to 15 of 15

Thread: Dht11 - 16f877a

Threaded View

  1. #13
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Dht11 - 16f877a

    That’s about how I would have gone about it i.e. reading it with timing, and looking at the buffer later,
    It looks like a job for portb.0 interrupt so the code doesn’t have to spend most time waiting.

    It’s a shame there isn’t an option in PBP to carry the bit after rotating a byte like humid to wrap it in a loop.
    For the last part the timing doesn’t matter anymore. There’s more than one way to skin a cat.

    Code:
    bb var byte ‘ bit index
    ii var byte ‘ counter
    dbit var byte[7] ‘ declare the array of bytes representing received bit times
    
    humid = 0 ‘ reset humid!
    bb = 1 ‘ set intial index value
    for ii = 0 to 6 ‘ address each bit
    if dbit[ii] > 29 then
    humid = humid + bb ‘ set the bit
    endif
    bb = bb + bb ‘ multiply index by 2 each step
    next ii
    Last edited by Art; - 31st March 2015 at 16:58.

Similar Threads

  1. DHT11? Code/Schematics?
    By wdmagic in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th June 2013, 10:35
  2. DHT11 Temperature/Humidity sensor
    By mircogomiero in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th January 2013, 13:37
  3. 16F877a - Please Help
    By tarexpanda in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 3rd April 2007, 09:28
  4. 16f877a
    By alaaodeh in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 7th February 2007, 00:38
  5. I need help with 16F877A
    By valerij in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th December 2006, 18:05

Members who have read this thread : 2

You do not have permission to view the list of names.

Posting Permissions

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