Code

// reverse motors to go forward
reverse(4);
// go at motor speed at 22/24% depending on room
//motorSpeed(4,22);  //308
motorSpeed(4,24); //244
//go to position 250 and cut power to all motors
goToAbsolutePosition(250); //244
//goToAbsolutePosition(250); //308
brake(4);
//coast to position 467/452 marks depending on room
goToAbsolutePosition(467);  // 244
//goToAbsolutePosition(452);  //308
// stop AEV
reverse(4);
motorSpeed(4,30);
goFor(1);
reverse(4);
brake(4);
goFor(8);
//start at motor speed 27% for 2 seconds then switch 22%
motorSpeed(4,27);
goFor(2);
motorSpeed(4,22);
// go until 720/645 marks depending on room
//goToAbsolutePosition(720);  //308
goToAbsolutePosition(745);  //244
//cut all power to motors
brake(4);
//coast to 980/986 marks depending on room
//goToAbsolutePosition(980);  //308
goToAbsolutePosition(986); //244
//stop AEV
reverse(4);
motorSpeed(4,30);
goFor(0.8);
reverse(4);
brake(4);
goFor(6);
//reverse motors to go backward at 45%
reverse(4);
motorSpeed(4,45);
// go to position 780/790 marks depending on room
goToAbsolutePosition(780);  //244
//goToAbsolutePosition(790);   //308
//cut all power to motors
brake(4);
//coast until position 553/551 depending on room
goToAbsolutePosition(553);  //244
//goToAbsolutePosition(551); //308
//stop AEV
reverse(4);
motorSpeed(4,40);
goFor(1);
reverse(4);
brake(4);
goFor(8);
//go at motor speed 45% until 240/300 marks depending on room
motorSpeed(4,45);
//goToAbsolutePosition(240); //308
goToAbsolutePosition(300); //244
//cut all power to motors
brake(4);
//coast to 35/0  marks depending on room
goToAbsolutePosition(35); //244
//goToAbsolutePosition(0); //308
//stop AEV
reverse(4);
motorSpeed(4,40);
goFor(.8);
reverse(4);
brake(4);
goFor(8);