This challenge is a decent step up from the previous challenges.
Rewrite your code so your robot stays perfectly still until it detects a person in front of it using a servo-mounted ultrasonic scan.
Your robot should slowly sweep the servo left–to–right (for example, between 30° and 150°) while staying still. When the ultrasonic sensor detects a person between 30 cm and 100 cm at any angle, the robot should immediately turn its wheels to face that direction and then charge forward at full speed.
Required Behavior:
Robot remains still.
Servo sweeps left → right → left in a continuous loop.
At each angle, the robot takes a distance reading.
If the sensor reads a distance between 30 cm and 100 cm in any direction during the sweep, the robot should stop the servo sweep, turn so it faces the direction where the person was detected, and then charge forward towards the detected object, stopping before it hits the object.
Extension:
If the object is moved away and the object is no longer detected, resets, and continues sweeping and scanning.
Trigger & Detection Accuracy:
Movement & Stop Behaviour:
Total:
Extension
New Total:
40%
40%
80%
20%
100%
When you are ready to submit your project, submit your code and pictures of your project to Google Classroom under Security Bot
YOU MUST SHOW ME YOUR PROJECT BEFORE YOU SUBMIT IT!