Quiz+4-7

Quiz 4-7:

Write a program with function calls including the functions that will spin the robot to the left as fast as it can go for 5 seconds, stop for 3 seconds, and then spin the robot to the right as fast as it can go for 5 seconds. I expect to see comments on each section of code that tells what it is doing .... such as "turning right for 5 seconds". Remember, in the real world you can NOT over comment. Note: this quiz is just like 4-6 but you are using the functions too!

note: the editor will not let me use the //usually to denote a comment, I have put them in// GREEN //.//

//void Left // // { // // motor[motorB]=100; Spin Left // // motor[motorC]=-100; // // wait1Msec(5000); // //} //

//void CalmDown Cool It // { motor[motorC]=0; //motor[motorC]=0; // <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;"> wait1Msec(3000); <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">}

<span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif; font-style: normal;">void Right <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">{ <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">motor[motorB]=-100; // Spin Right <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif; overflow-x: hidden; overflow-y: hidden;"> motor[motorC]=100; <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif; overflow-x: hidden; overflow-y: hidden;"> wait1Msec(5000); <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif; overflow-x: hidden; overflow-y: hidden;"> }

<span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">task main <span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;">{ <span style="font-family: arial,helvetica,sans-serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">Left; <span style="color: #008000; font-family: 'Comic Sans MS',cursive;">Spin Left <span style="color: #000000; font-family: arial,helvetica,sans-serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">Left; <span style="color: #008000; font-family: 'Comic Sans MS',cursive;">No Spin <span style="color: #000000; font-family: arial,helvetica,sans-serif; margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; overflow-x: hidden; overflow-y: hidden; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;"><span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">Right; <span style="color: #008000; font-family: 'Comic Sans MS',cursive;">Spin Right

<span style="color: #0000ff; font-family: 'Arial Black',Gadget,sans-serif;">}