task main() { initializeRobot(); //waitForStart(); // Wait for the beginning of autonomous phase. /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// //// //// //// Add your robot specific autonomous code here. //// //// //// /////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////// drive_inches(24); drive_inches(-24); /* nMotorEncoder[leftFront] = 0;//nMotorEncoder is just to let the it know we are beginniung to program with an encoder nMotorEncoder[leftBack] = 0;//motors are being set to 0 before the while loop just in case nMotorEncoder[rightFront] = 0; nMotorEncoder[rightBack] = 0; wait1Msec (50);//after reading some blogs we thought that it was neccessary to wait between functions while((nMotorEncoder[leftFront] < degreeRotation) && (nMotorEncoder[leftBack] < degreeRotation) && (nMotorEncoder[rightFront] < degreeRotation) && (nMotorEncoder[rightBack] < degreeRotation))//this while loop only lets the following code run when motor A and B have not rotated more than { motor[leftFront] = 100; motor[leftBack] = 100; motor[rightFront] = 100; motor[rightBack] = 100; } motor[leftFront] = 0; motor[leftBack] = 0; motor[rightFront] = 0; motor[rightBack] = 0; */ wait1Msec (50); // I believe the purose of this infinite while loop is to // put the robot in an idle state until the Field Control // system switches to teleop mode. As such, this loop // should stay here. while (true) {} }
void simple_autonomous(){ wait1Msec(500); // on close edge of tile drive_inches(14.5); // works drive_inches(14.5); // touching wall drive_inches(28.5); // works wait1Msec(500); rotate_degrees_right(90); // works wait1Msec(500); reverse_until_bumpers(); // WOULD BE F*****G AWESOME IF ROBOTC HAD FUNCTION POINTERS! // stay put for 4 seconds while the hook lowers! wait1Msec(4000); // drive_inches_slow(2); motor_set(0, 0); // do nothing; mission accomplised // print to LCD for bonus points? }