Quiz+4-19

Quiz 4-19:

Declare an integer variable "L", write a function called "ReadLeft" that will turn the robot left and and read the value from a sonar sensor called "Sonic1" into the variable L. You also need to show me how to call the function ReadLeft from the main program.

 int L; //Declare the variable L//

 void ReadLeft  {  motor[motorB] = 50;  motor[motorC] = -50;  wait1Msec(600); Point turn left for .6 seconds

 L = SensorValue(Sonic1); //the Sonar Sensor //

 }

<span style="color: #0a00ff; font-family: 'Arial Black',Gadget,sans-serif; overflow-x: hidden; overflow-y: hidden;"> task main <span style="color: #0a00ff; font-family: 'Arial Black',Gadget,sans-serif; overflow-x: hidden; overflow-y: hidden;"> { <span style="font-family: arial,helvetica,sans-serif; overflow-x: hidden; overflow-y: hidden;"><span style="color: #0a00ff; font-family: 'Arial Black',Gadget,sans-serif;"> ReadLeft; <span style="color: #008000; font-family: 'Arial Black',Gadget,sans-serif;">Make the function call to ReadLeft <span style="color: #0a00ff; font-family: 'Arial Black',Gadget,sans-serif; overflow-x: hidden; overflow-y: hidden;"> }