Codes

Codings 

for Power Braking test:

motorSpeed(4, 50);

  goFor(2.5);

  reverse(4);

  motorSpeed(4, 50);

  goFor(1);

  brake(4);

 

for Coast Braking test:

reverse(4);

 motorSpeed(4, 40);

  goFor(2.1);

  brake(4);

 

for Energy Analysis:

motorSpeed(4,30);

goFor(4);

motorSpeed(4,0);

goFor(10);

 

Activity 4 Code

celerate(4,0,25,3); – accelerates all motors from no power to 25% power in 3 seconds
motorSpeed(4,25); – Sets all motor speeds to 25% power
goFor(1); – Runs the motors at their initialized state for 1 second
motorSpeed(4,20); – Sets all motor speeds to 20% power
goFor(2); – runs the motors at their initialized state for 2 seconds
reverse(4); – reverses polarity of all motors
motorSpeed(4,25); – Sets all motor speeds to 25% power
goFor(2); – Runs the motors at their initialized state for 2 seconds
brake(4); – cuts the power to all motors

motorSpeed(4, 50);

goFor(2.5);

reverse(4);

motorSpeed(4, 50);

goFor(1);

brake(4);