Merged the Pulsein/out code from: https://github.com/jgautier/arduino-1/...

Tested using https://github.com/rwldrn/johnny-five ping example

Let me know if you think anything should be changed