Quiz+03

Robotics Quiz 3

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

Go Forward at Full power for 5.5 seconds. Point turn RIGHT at Half power for 2 seconds. Go Backward at 20% power for 0.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 Full Power for 5.5 seconds

motor[motorB]=100;

motor[motorC]=100;

wait1Msec(5500);

======================== Point Turn Right Half Power for 2 seconds

motor[motorB]=-50;

motor[motorC]=50;

wait1Msec(2000);

//======================== Backwards Half Power for 0.4 seconds

motor[motorB]=-20;

motor[motorC]=-20;

wait1Msec(400);

} 