Performance Testing Arduino Codes

 


Performance Test 1:


Code:

reverse(4);

celerate(4, 0, 35, 4);      %accelerate the motors

motorSpeed(4, 35);        % keep the motors going

goToAbsolutePosition(-206);  % go the number of tick marks to the sensor then shut off motors

reverse(4);                              %power brake

goFor(2);

brake(4);

goFor(7);                               %stop for 7 seconds at gate

reverse(4);

celerate(4, 0 , 35, 3);            %accelerate through gate

motorSpeed(4, 35);

goFor(3);

brake(4);                          %shut motors off and coast into the caboose


Performance Test 2:


Code:

reverse(4);
celerate(4, 0, 35, 4);                  %accelerate the motors
motorSpeed(4, 35);                  % keep the motors going
goToAbsolutePosition(-212);  % go the number of tick marks to the sensor then shut off motors
brake(4);
reverse(4);                           %power brake
motorSpeed(4, 30);
goFor(1);
brake(4);
goFor(7);                      %stop for 7 seconds at gate
reverse(4);
celerate(4, 0 , 33, 3);        %accelerate through gate
motorSpeed(4, 33);
goFor(3.5);
brake(4);                           %shut motors off and coast into the caboose
goFor(10);                   %wait in loading zone for about 5 seconds
reverse(4);                     % reverse the motors then begin to pull the caboose back to start
celerate(4, 0 , 45, 3);
motorSpeed(4, 45);
goFor(1);


Final Performance Test:


Code:

reverse(4);
int midMark = 180;      %sets distances for long/short bursts
int endMark = 193;

while(getVehiclePostion() < midMark) {             %long bursts up the first hill
motorSpeed(4, 55);
goFor(1);
brake(4);
goFor(1);
}

while(getVehiclePostion() < endMark) {              %short bursts right before first sensor
motorSpeed(4, 40);
goFor(0.25);
brake(4);
goFor(0.5);
}

brake(4);                                      %power braking at first sensor
reverse(4);
motorSpeed(4, 23);
goFor(1);
brake(4);
goFor(7);                                     %wait at the gate for 7 seconds
reverse(4);

motorSpeed(4, 33);                       %power to coast down and get the caboose
goFor(3.5);
brake(4);
goFor(10);
reverse(4);

int midMark2 = 470;                %sets distances on the way back
int endMark2 = 433;

while(getVehiclePostion() > midMark2) {          %long bursts up the second hill
motorSpeed(4, 63);
goFor(1);
brake(4);
goFor(1);
}

while(getVehiclePostion() > endMark2) {             %short bursts before the second sensor
motorSpeed(4, 45);
goFor(0.25);
brake(4);
goFor(1);
}

brake(4);                                          %power braking at second sensor
reverse(4);
motorSpeed(4, 35);
goFor(1);
brake(4);
goFor(7);                                   %wait at the gate for 7 seconds
reverse(4);

motorSpeed(4, 40);                %power to coast back to the starting dock
goFor(2.5);
brake(4);

reverse(4);                               %power braking at the starting dock
motorSpeed(4, 28);
goFor(2);
brake(4);

AEV FINAL RUN VIDEO-2594i4n