Week 2/3

External Sensor Inside Track Code

motorSpeed(4,25);                                   //Run all motors at 25% power

goFor(2);                                                    //Run last command for 2 sec

motorSpeed(4,20);                                  //Set all motors to 20% power

goToAbsolutePosition(324);                 //Continue until 13.5 feet from the starting point

reverse(4);                                                 //Reverse spin direction of all motors

motorSpeed(4,30);                                  //Set all motors to 30% power

goFor(1);                                                    //Run last command for 1 sec

brake(4);                                                    //Brake all motors