Skip to content

Commit e4fdb9e

Browse files
committed
tuned costant for pulseIn
1 parent 1aea8f3 commit e4fdb9e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hardware/arduino/sam/cores/arduino/wiring_pulse.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ extern uint32_t pulseIn( uint32_t pin, uint32_t state, uint32_t timeout )
5454
}
5555

5656
// convert the reading to microseconds. The loop has been determined
57-
// to be 22 clock cycles long and have about 16 clocks between the edge
57+
// to be 52 clock cycles long and have about 16 clocks between the edge
5858
// and the start of the loop. There will be some error introduced by
5959
// the interrupt handlers.
60-
return clockCyclesToMicroseconds(width * 22 + 16);
60+
return clockCyclesToMicroseconds(width * 52 + 16);
6161
}

0 commit comments

Comments
 (0)