Quiz+05

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  for each behavior, you need to have a comment line above your function telling me what your function is going to do.

Yes, print first and last name at the BOTTOM along with DATE.

// =========================================== Function to Go Forward for 2 seconds void GoForward { motor[motorB]=50; <span style="font-family: 'Arial Black',Gadget,sans-serif; font-size: 130%;">motor[motorC]=50; <span style="font-family: 'Arial Black',Gadget,sans-serif; font-size: 130%;">wait1Msec(2000); <span style="font-family: 'Arial Black',Gadget,sans-serif; font-size: 130%;">} <span style="font-family: 'Arial Black',Gadget,sans-serif; font-size: 130%;">// =========================================== Function to do a Point Turn RIGHT <span style="font-family: 'Arial Black',Gadget,sans-serif; font-size: 130%;">void TurnRight <span style="font-family: 'Arial Black',Gadget,sans-serif; font-size: 130%;">{ <span style="font-family: 'Arial Black',Gadget,sans-serif; font-size: 130%;">motor[motorB]=-50; <span style="font-family: 'Arial Black',Gadget,sans-serif; font-size: 130%;">motor[motorC]=50; <span style="font-family: 'Arial Black',Gadget,sans-serif; font-size: 130%;">wait1Msec(2000); <span style="font-family: 'Arial Black',Gadget,sans-serif; font-size: 130%;">} <span style="font-family: 'Arial Black',Gadget,sans-serif; font-size: 130%;">// ========================================= The Main Program, it calls FUNCTIONS <span style="font-family: 'Arial Black',Gadget,sans-serif; font-size: 130%;">task main <span style="font-family: 'Arial Black',Gadget,sans-serif; font-size: 130%;">{ <span style="font-family: 'Arial Black',Gadget,sans-serif; font-size: 130%;">GoForward <span style="font-family: 'Arial Black',Gadget,sans-serif; font-size: 130%;">TurnRight <span style="font-family: 'Arial Black',Gadget,sans-serif; font-size: 130%;">GoForward <span style="font-family: 'Arial Black',Gadget,sans-serif; font-size: 130%;">}