Ultrasonic Proximity Sensor Library for Arduino
What is it?
This library (with example) is designed to be integrated in projects using ultrasonic proximity sensors.
It was tested with HC-SR04 device but it should be usable with equivalent sensors which have a trigger and echo pins.
How to install
Download latest release
On your Arduino IDE, click "Sketch" menu and then "Include Library > Add .ZIP Libraries"
You can now use the library for your project or launch an example ("File > Examples")
How to connect the sensor to your Arduino
|Ultrasonic proximity sensor||Arduino|
|Echo||D2 (or any other digital pin)|
|Trigger||D3 (or any other digital pin)|
One example is provided with this library:
Show distance between the sensor and any element every second
This project is under MIT license. This means you can use it as you want (just don't delete the library header).
If you want to add more examples or improve the library, just create a pull request with proper commit message and right wrapping.