The following video shows the servo motor where we have to use C++ to code the Arduino to receive input from the sensor and output to the servo to change directions.

I had to connect the servo motor and the sensor to my Arduino. Made sure to connect them properly and check the pin configurations that were on the breadboard which then led to me coding my Arduino I did run into a problem with the servo but after testing with a different servo it did work so the code was right but the servo was messed up but after some working with it we fixed the servo and functioned correctly with the code and the sensor started to work again.