Junk+2

Robotics Quiz 5

Write a RobotC program to make your NXT do the following behaviors: NOTE: You need to use ALL FUNCTIONS  in task main.

Go Forward for 2 seconds at half power (Call this function GoForward ). Point Turn Right for 0.5 seconds (Call this function TurnRight ). Go Forward for 2 seconds at half power (Call this function GoForward ).

NOTE: I expect you to provide a line of COMMENT <span style="color: #0000ff; font-family: 'Comic Sans MS',cursive; font-size: 24px;"> for each behavior, you need to have a comment line above your function telling me what your function is going to do.

<span style="color: #0000ff; font-family: 'Comic Sans MS',cursive; font-size: 24px;">Yes, print first and last name at the BOTTOM along with DATE.

//<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">// =========================================== Function to Go Forward for 2 seconds ////<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">void GoForward ////<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">{ ////<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">motor[motorB]=50; ////<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">motor[motorC]=50; ////<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">wait1Msec(2000); ////<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">} //

//<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">// =========================================== Function to do a Point Turn RIGHT ////<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">void TurnRight ////<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">{ ////<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">motor[motorB]=-50; ////<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">motor[motorC]=50; ////<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">wait1Msec(2000); ////<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">} //

//<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">// ========================================= The Main Program, it calls FUNCTIONS ////<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">task main ////<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">{ ////<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">GoForward ////<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">TurnRight ////<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">GoForward ////<span style="color: black; font-family: 'Arial','sans-serif'; font-size: 9px;">} //