Question: Exercise 1 Implement the ultrasonic sensor to read the distance between it and an object of your choosing. Pressing the left button changes the display
Exercise
Implement the ultrasonic sensor to read the distance between it and an object of your choosing. Pressing the left button changes the display between centimeters and inches.
Task : Sonar Task Period: ms
Use the ultrasonic sensor to measure the distance.Place an object of your choice in front of the sensor to measure its distance
Task : Display Task Period: ms
Output the distance obtained from the ultrasonic sensor onto the DS displayThe display should initially show the distance in centimeters.
Task : Left Button Task Period: ms
When the left button is pressed, toggle the DS display to show the distance between centimeters and inches
Hint: Declare a variable that holds the distance as a global variable so that different tasks can read its value.
Hint : If you encounter "ghosting" effect on your DS try swapping the order of setting the digit display and calling outNum For example, if you set the digit to be displayed first then call outNum change it so that you call outNum first. And vice versa
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
