WiringPi / WiringPi-Node

Node.js bindings to wiringPi
334 stars 94 forks source link

No timeout exposed on pulseIn #40

Closed nkolban closed 7 years ago

nkolban commented 8 years ago

Reading the documentation on the use of the pulseIn() function, it talks about returning 0 if no pulse is measured in the specified timeout. Unfortunately, there doesn't appear to be a parameter to supply a timeout. Would it be possible to clarify the docs to discuss the timeout (if present) is more detail?

nekuz0r commented 7 years ago

Looks like it's an error in the documentation, because pulseIn only expects 2 parameters pin and state.

But it will returns 0 no state change occurred in an hardcoded timeout. https://github.com/nekuz0r/wiringpi/blob/6d98e0c87ad937849af944ae7118ce1e01ce7c91/wiringPi/wiringPi.c#L1483