Arduino Homework 2 – Ultrasonic Sensor

Assignment 2: Arduino, CC Lab & Lec

In the process of learning to connect sensors to the arduino as inputs, I used the ultrasonic sensor that measures proximity by echoing and triggering ultrasonic sound. In the code used, I put a limit of 10 inches on the sensor to trigger a light change. So if the sensor detects a distance of more than 10 inches, the yellow light remains on and if the distance detected is less than 10 inches, then the yellow light switches off and the blue light turns on.



Link to code used: