The code for lab 2 included testing the reflectance sensors of the AEV prototype model. The reflectance sensors allow the AEV to determine how far it has travelled along the track. The code associated with the sensor tests is as follows:
motorSpeed(4,25); //Runs all motors at 25% power goFor(2); //motors run for 2 seconds motorSpeed(4,20); //Runs all motors at 20% power goToAbsolutePosition(70); //Motors run for 12ft reverse(4); //Reverse motor polarity of all motors motorSpeed(4,30); //Runs all motors at 30% power goFor(1.5); //Runs motors for 1.5 seconds brake(4); //Brakes all motors