Quiz+4-8

Quiz 4-8:

Write a program that would continually move the robot forward while reading a light sensor (Light2) into a variable "L". The Light sensor should be continually read while the robot moves forward and call a function "StopMe" if the light reading is less than 24. You may use your notes, programs, or previous quizzes to assist you in taking this quiz. No, you do not have to write the function that is called "StopMe", assume it is already written. (you are welcome :)

int L;

task main { while(1) {  motor[motorB]=50;  motor[motorC]=50;  L = SensorValue(Light2);  if (L<24) StopMe; } }