Lab 8 Tuesday, October 19, 2021
Description: The final lab exercise using the original Lego robotic vehicle will be broken up over two lab sessions. This exercise will combine the components from previous labs.
Details:
- The vehicle will follow a black line.
- The vehicle will also be following the leader (the cuboid or another vehicle) which will be following the same line and will vary its speed slightly.
- Your vehicle must slow down if the leader gets to within 15 centimeters and speed back up if the distance increases again.
- If the leader gets to within 6 centimeters, have your vehicle stop moving. If the leader moves away, have your vehicle start moving again.
- If your vehicle runs over a red spot, it should stop.
- If someone (or something) runs into your vehicle from behind, it should sound an alarm (again please not too annoying, thank you!), spin around 180 degrees and stop.
- If the center brick button is pressed, have the brick say Goodbye (please at a low volume for everyones sake) and your vehicle should stop.
Components:
- You will need an ultrasonic sensor on the front of your vehicle.
- You will need a color sensor on your vehicle pointing down.
- You will need a touch sensor on the back of your vehicle facing out.
- Create your own block to follow the line.
- Create your own block to adjust the speed based on the leader movement.
- Create your own block to react to the touch sensor being pressed.
- Use parallel programming to deal with various stopping requirements.
Extra Credit:
- Have the display constantly update the distance between your vehicle and the leader.