View previous topic :: View next topic |
Author |
Message |
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19548
|
|
Posted: Mon Mar 03, 2014 2:19 pm |
|
|
<http://www.ccsinfo.com/forum/viewtopic.php?t=51358&highlight=dht22> |
|
|
ezflyr
Joined: 25 Oct 2010 Posts: 1019 Location: Tewksbury, MA
|
|
Posted: Mon Mar 03, 2014 2:37 pm |
|
|
rikotech8,
When people ask such drop-dead obvious questions that could have been answered with a simple forum search, a lot of folks relegate those people to the 'totally hopeless, waste-of-time' category.......
Just sayin'.......
John |
|
|
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
|
Posted: Tue Mar 04, 2014 11:39 am |
|
|
First, searching RHT03 is different than searching THD right? I used the search into the forum for RTH-03 with no results "No topics or posts met your search criteria".
Since I read the code I wonder how this routine could return number bigger than 0x0F, four bits filled in only, whatever is the serial input? It suppose to return 8bit value.
Code: |
for(iIndex = 0; iIndex < 8 ; iIndex++)
{
bExit = False;
set_timer0(0);
while (!input(DHT_IO) && !bExit);
delay_us(30);
if (input(DHT_IO))
{
iValue = iValue |(1<<(7 - iIndex));
bExit = False;
set_timer0(0);
while (input(DHT_IO) && !bExit);
}
}
return iValue;
}
|
iValue cant be more than dec.15. I need 8 bit value returned.
I dont know if some1 have tried it but for me it wont work. Maybe I mistake? _________________ A person who never made a mistake never tried anything new. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19548
|
|
Posted: Tue Mar 04, 2014 11:47 am |
|
|
iIndex = 0; iIndex < 8
8 values. Where are you getting 4 from?. |
|
|
rikotech8
Joined: 10 Dec 2011 Posts: 376 Location: Sofiq,Bulgariq
|
|
Posted: Tue Mar 04, 2014 12:49 pm |
|
|
Sorry my mistake! _________________ A person who never made a mistake never tried anything new. |
|
|
|