Exercise 1- Arduino Function Code

Arduino Function Code

celerate(m,p1,p2,t);

Accelerates or decelerates motor(s) m from start speed (%) p1 to end speed (%) p2 over a duration of t seconds

motorSpeed(m,p);

Initializes motors (m) at percent power p

goFor(t);

Runs motors at their initialized states for t seconds

brake(m);

Brakes motor(s) m; Does not break motors, but rather cuts off engines

reverse(m);

reverse the polarity of the motor(s) m

goToRelativePosition(n);
continues the previous command for n marks from the vehicles current position. n can be positive (meaning forward) or negative (meaning reverse)
goToAbsolutePosition(n);
continues the previous command for n marks relative to the overall starting position of the AEV.