Make 3 LEDs turn off and on depending on the distance measured by the ultrasonic sensor.
Arduino Uno
Breadboard
HC-SR04 sensor
2x LED
2x 220 Ω resistor
Wires
To be able to complete this project is recommend that you read the Control Strutures, Variables and Functions pages.
To use the HC_SR04 sensor, read the page Ultrasonic Distance Sensor and use the code provided there.
This video explains step by step how to code this project.