Lab 2: AEV External Sensors

ExternalSensorsOutside code:

//Run all motors at a constant speed of 25% power for 2 seconds.
motorSpeed(4,25);
goFor(2);
//Run all motors at a constant speed of 20% and using the goToAbsolutePosition function travel a total distance of 12 feet (from the starting point). You will actually rotate the wheel by hand (since you are on the desktop tracks) until the wheel has completed the required distance and the motors stop..
motorSpeed(4,20);
goToAbsolutePosition(395);
//Reverse motors.
reverse(4);
//Run all motors at a constant speed of 30% power for 1.5 second.
motorSpeed(4,30);
goFor(1.5);
//Brake all motors.
brake(4);

 

Reflectance Sensor:

The reflectance sensors are important because they allow the AEV to calculate how far it has moved along the track. This is very important for an autonomous task involving transportation, because it allows the system to safely stop at locations to pick up a load, without running off the rails.