Description
Part 1:Â Programming the MSP432 board
Attach the servo as shown in the photo below, unless you use a level converter board (recommended)
Keep the ultrasound sensor attached (same wiring) as in lab 3. Find a way to mount the ultrasonic sensor on the servo arms. The setup does not need to be on the robot.
You will control the servo to turn to 0, 90, and 180 degrees and make ultrasound measurements at each position.
Again, like in lab 3, you are to take the median value of readings. Take five readings (you can do it faster this time, and you do not need to put your hand in front of the sensor). In the video, you only need to show the physical setup once at the beginning, then the screen while running two cycles (0, 90, 180 degrees).
The video you record should be no more than 30 seconds, and should capture the screen showing your measurements and the outputted best value. An example on the screen would be (in the Serial Monitor window):
Measuring at 0 degrees
Distance = 20 centimeters
Distance = 20 centimeters
Distance = 20 centimeters
Distance = 10 centimeters
Distance = 20 centimeters
Median distance at 0 degrees = 20 centimeters
Measuring at 90 degrees
Distance = 20 centimeter
Distance = 20 centimeter
Distance = 20 centimeter
Distance = 10 centimeter
Distance = 20 centimeter
Median distance at 90 degrees = 20 centimeters
Measuring at 180 degrees
Distance = 21 centimeter
Distance = 5 centimeter
Distance = 21 centimeter
Distance = 22 centimeter
Distance = 20 centimeter
Median distance at 180 degrees = 21 centimeter