Question: Create a function that will cause the simulated robot to drive forwards over the background until one of the light sensors detects a change in
Create a function that will cause the simulated robot to drive forwards over the background until one of the light sensors detects a change in the colour of the background. Provide a simple test program that demonstrates your function behaves as expected.
Create a second function that will accept two parameters and will cause the simulated robot to turn by a specified amount in a specified direction.
Using your two functions, or otherwise, create a program that will cause the simulated robot to drive over the Greybands background and demonstrate a change in direction each time a change is detected in the colour of the background. When the robot detects the black line, it should draw a circle and the program should end. Use the following block magic when running your program.
simmagicpreloaded Cp b Greybands x y a
Include in your TMA document a screenshot of your code and the simulator output after running the program; also include of copy of your code as text.
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
