Quiz+04

Robotics Quiz 4

Write a RobotC program to make your NXT do the following behaviors:

Go Forward at Half power for 0.6 seconds. Do not move (Robot stops), for 8 seconds. Go Forward at Full power for 4 seconds.

NOTE: I expect you to provide a line of COMMENT  for each behavior.

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

Answer:

task main

{ //======================== Forward Half Power for 0.6 seconds motor[motorB]=50; motor[motorC]=50; wait1Msec(600);

//======================== Stop and stand still for 8 seconds

motor[motorB]=0;

motor[motorC]=0; wait1Msec(8000);

//======================== Forward Full Power for 4 seconds

motor[motorB]=100; motor[motorC]=100;

wait1Msec(4000);

} 