//*!!Sensor,    S1,      rotationSensorA, sensorRotation,      ,                 !!*//
//*!!Sensor,    S2,      rotationSensorB, sensorRotation,      ,                 !!*//
//*!!                                                                            !!*//
//*!!Start automatically generated configuration code.                           !!*//
const tSensors rotationSensorA      = (tSensors) S1;   //sensorRotation     //*!!!!*//
const tSensors rotationSensorB      = (tSensors) S2;   //sensorRotation     //*!!!!*//
//*!!CLICK to edit 'wizard' created sensor & motor configuration.                !!*//

//******************************************************************************//
//                              Run Straight                                    //
//                              (RobotC on NXT)                                 //
//										//
//  This program allows your robot to run forward until either of the motors    //
//  has reached an assigned number of rotational clicks.                        //
//                                                                              //
//******************************************************************************//
//				Focus						//
//                                                                              //
//  We use the boolean "and" operator "&&" in a while condition, implying that  //
//  both condition have to be true in order to execute the loop's code.         //
//                                                                              //
//******************************************************************************//
//				Notes						//
//                                                                              //
//  1. Be sure to reset the rotation sensor before comparing its value.         //
//                                                                              //
//******************************************************************************//
//                              Motors & Sensors                                //
//                                                                              //
//  To modify Motors & Sensors Configuration in Robot C, go to View -> Motors   //
//  & Sensors Setup.  This will change the automatically generated code.        //
//										//
//  [I/O PORT]    [Name]          [Type]               [Description]            //
//  Port A	  none            motor                 right motor             //
//  Port B	  none            motor                 left motor              //
//  Port 1	  rotationSensorA Rotation              Motor A Rotation Sensor //
//  Port 2	  rotationSensorB Rotation              Motor B Rotation Sensor //
//                                                                              //
//******************************************************************************//


task main()
{
  ClearSensorValue(rotationSensorA);                                               //rotation sensor A is reset to 0
  ClearSensorValue(rotationSensorB);                                               //rotation sensor B is reset to 0

  while(SensorValue(rotationSensorA) < 320 && SensorValue(rotationSensorB) < 320)  //a while loop is delcared with rotation sensor A less than 320 AND rotation sensor B less than 320 as its true condition
  {
    motor[motorA] = 100;	                                                   //motor A is run at a 100 power level
    motor[motorB] = 100;                                                           //motor B is run at a 100 power level
  }
}