pulseIn bug

Right now I use Arduino 1.0.3

File /usr/share/arduino/hardware/arduino/cores/arduino/Arduino.h has the following definitions:

#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
#define microsecondsToClockCycles(a) ( (a) * clockCyclesPerMicrosecond() )

F_CPU = 16 000 000
-----> clockCyclesPerMicrosecond = 16
"width" value (in my tests) was not more 736 (~550-736) ---> about 7-13 centimeters
(I temporary changed return value in wiring_pulse.c to get width from there)

File /usr/share/arduino/hardware/arduino/cores/arduino/wiring_pulse.c

return clockCyclesToMicroseconds(width * 21 + 16);

and problem still exists. :disappointed_relieved: