Automatic Sensor Servo
I built a servo circuit where the servo moved to 90 degrees when a object was detected within 20 cm whereas it would come back to 0 degree if it did not detect any object within 20 cm. I understood how the loop function in the code works