Quiz+07

Robotics Quiz 7

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

Go Forward Point Turn Left

Go Forward

Point Turn Left

NOTE: I expect you to provide a line of COMMENT for each function. Remember, Function names do NOT have spaces in them :)

// ============================ Go Forward 2 Seconds at Half Speed void GoForward { motor[motorB]=50; <span style="color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">motor[motorC]=50; <span style="color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">wait1Msec(2000); <span style="color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">}

<span style="color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">// ============================================ Point Turn Left <span style="color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">void TurnLeft <span style="color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">{ <span style="color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">motor[motorB]=50; <span style="color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">motor[motorC]=-50; <span style="color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">wait1Msec(500); <span style="color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">}

<span style="color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">// ============================================= Main Program <span style="color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">task main <span style="color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">{ <span style="color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">GoForward; <span style="color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">TurnLeft; <span style="color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">GoForward; <span style="color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">TurnLeft; <span style="color: #000000; font-family: Arial,Helvetica,sans-serif; font-size: 24px;">}