Warning
This library is no longer maintained here. Adafruit adopted this
driver, fixed several bugs (including the hang this version used to have
when the sensor didn't respond), and added support for boards that don't
have pulseio. The result is the officially supported version,
distributed in the Adafruit CircuitPython Bundle and on
PyPI as
adafruit_hcsr04:
https://github.com/adafruit/Adafruit_CircuitPython_HCSR04
If you're starting a new project, use that version instead. This repository is kept for historical reference. The code here has been updated to match Adafruit's bug fixes, but gets no further development.