mod to the response timing

This commit is contained in:
Nicolas Sanz 2013-03-22 18:14:13 -03:00
parent 672289be60
commit 95fa6826ce

View File

@ -68,9 +68,10 @@ void idDHT11::isrCallback() {
} }
switch(state) { switch(state) {
case RESPONSE: case RESPONSE:
if(delta<25) if(delta<25){
return; //do nothing, it started the response signal us -= delta;
if(125<delta && delta<170) { break; //do nothing, it started the response signal
} if(125<delta && delta<190) {
state = DATA; state = DATA;
} else { } else {
detachInterrupt(intNumber); detachInterrupt(intNumber);
@ -83,7 +84,6 @@ void idDHT11::isrCallback() {
detachInterrupt(intNumber); detachInterrupt(intNumber);
status = IDDHTLIB_ERROR_DELTA; status = IDDHTLIB_ERROR_DELTA;
state = STOPPED; state = STOPPED;
// return;
} else if(60<delta && delta<135) { //valid in timing } else if(60<delta && delta<135) { //valid in timing
if(delta>90) //is a one if(delta>90) //is a one
bits[idx] |= (1 << cnt); bits[idx] |= (1 << cnt);