I use ultrasonic to measure the distance.
- pulseIn(pin, value) - working, but not as documentation describe it: timeout "default is one second"
I have only 450 us pause to start capture the pulse.
- pulseIn(pin, value, timeout) - returns 0 with any value of timeout
please post your code and schematic.
what board are you using?
which version of the IDE?
- timeout does not have a default value,
PulseIn() is a less accurate functions:
- timeout is in microseconds and INCLUDES the waiting time before the pulse
- different versions of the compiler optimizes the code differently causing up to 15% deviation
- it contains hard coded magic numbers e.g. 16 for clock which is not always true.
Think the pulseIn() code is reasonably valid for 16MHZ UNO and MEGA but not for ARM