Question: Please provide clear explanation for each step (a) Draw a flow chart to a program that will have a steering servo motor move based on
Please provide clear explanation for each step
(a) Draw a flow chart to a program that will have a steering servo motor move based on an input from a light sensor. The rover can follow the dark line on the floor because of the light reflected from that dark line has low intensity. When the rover goes off course and there is no more dark line on the floor below the rover, the light intensity is higher. The light intensity values of the light sensor will range from 0 to 1023 (higher values corresponding to brighter light). When the value of the light intensity increases above 400 it means that the rover is off course and the servo motor that controls the steering of the rover should be activated to put the rover back on course. We will assume that if light intensity is below 400, no steering should be performed, when the light intensity is above 400, the servomotor should go to -45 degrees until the light intensity drops below 400. We will assume for simplicity that our rover only veers to the right to get off the line and it would require to move servo to -45 degrees to put the rover back over the line. Once the light intensity falls below 400, the servo moves to 0 degrees. This procedure is performed in a loop to keep the rover over the dark line. (b) Write this algorithm using pseudo code. (c) Write the algorithm as if you are writing in Arduino IDE
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
