Advanced R&D Coding

Coasting vs. Braking

Arduino code for Coasting:

//reverse all motors

reverse(4);

// set all motors speed to 30%

motorSpeed(4,30);

// go to the absolute position -150 marks

goToAbsolutePosition(-150);

// brake all the motor

brake(4);

 

Arduino code for Braking:

//reverse all motors

reverse(4);

// set all motors speed to 30%

motorSpeed(4,30);

// go to the absolute position -150 marks

goToAbsolutePosition(-150);

// brake all the motor

brake(4);

// reverse all the motors

reverse(4);

// set all motors speed to 35%

motorSpeed(4,35);

// keep the speed for 1 second

goFor(1);

// brake all the motors

brake(4);