This library was made for an mBot platform created by Makeblock.
To read more follow:
https://medium.com/p/c3e310f8eceb
https://medium.com/p/2ae4a4862a9e
https://medium.com/p/6c420600271e
Copy of std Ultrasonic range, but returns Max distance on failure so we can assume nothing close to us. My sensor seems to go low on ping capture, not success, so I changed timeout to max round trip to get full range.
Contains encoder KY040 patch, digital pullup input patch, example of usage. Encoder reads boolean inputs to obtain numerical value of revolution. Boolean outputs are used for clockwise and counterclockwise direction detection respectively.