Quiz+02

Robotics Quiz 2

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

Go Forward at 80% power for 2 seconds. Swing turn RIGHT at 60% power for 7 seconds. Go backwards at Half power for 2.5 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 80% Power for 2 seconds motor[motorB]=80;

motor[motorC]=-80;

wait1Msec(2000);

======================== Swing Turn Right 60% Power for 7 seconds motor[motorB]=0;

motor[motorC]=60;

wait1Msec(7000);

//======================== Backwards Half Power for 2.5 seconds

motor[motorB]=-50;

motor[motorC]=-50;

wait1Msec(2500);

}