Project Portfolio


Assembly video of the Final AEV Design


Final Code Used


//reverse 2nd motor
//reverse(2); // no need to reverse
//use first motor to move forward, scaling down to the most efficient power value
motorSpeed(1,40);
goFor(1);
motorSpeed(1,25);
//use end speed to go to next mark
//goToAbsolutePosition(246);
//stop current draw from motor
//brake(4);
//coast to mark, then turn on motor to brake
goToAbsolutePosition(300);
brake(4);
//aev MUST stop between marks 501 and 517, no further and no shorter,
//for the gate to be triggered sucessfully
goToAbsolutePosition(450);

int Direction = getVehicleDirection();
while(Direction == 1){
Direction = getVehicleDirection();
motorSpeed(2,27);
if(Direction == 2){
brake(4);
break;
}
}
brake(4);
goFor(7);

//should trigger the sensor and have a time delay, such that the next thrust gets it going
//out of the gate

motorSpeed(1,40);
goFor(1.5);
motorSpeed(1,25);
goToAbsolutePosition(780);
brake(4);

//go to R2D2, wait 4 seconds for loading
goToAbsolutePosition(910);
goFor(7);
//celerate out of the loading area with the R2D2.
celerate(2,50,40,3);
goToAbsolutePosition(682); // close to the sensor
brake(4);
goToAbsolutePosition(550); // Return sensor!
Direction = getVehicleDirection();
while(Direction == 0){
Direction = getVehicleDirection();
motorSpeed(1,45);
if(Direction == 2){
brake(4);
break;
}
}
brake(4);
goFor(7);
celerate(2,50,40,3);
goToAbsolutePosition(180);
brake(4);