Code 2

//reverse all motors to begin

reverse(4);

//accelerate from 0 to 30% on all motors in 2 seconds

celerate(4,0,30,2);

//go at 27% for 2 seconds

motorSpeed(4,27);

goFor(2);

//go at 23% until 395 marks

motorSpeed(4,23);

goToAbsolutePosition(395);

//reverse motors to continue going forwards at motor speed 27% for 2.1 seconds

reverse(4);

motorSpeed(4,27);

goFor(2.1);

//cut all power to motors

brake(4);

// go at 30% motor speed for 100 marks

reverse(4);

motorSpeed(4,30);

goToRelativePosition(100);

reverse(4);

//accelerate from 0 to 30% motor speed in 2 seconds

celerate(4,0,30,2);

//go at 23% until 1030 marks

motorSpeed(4,23);

goToAbsolutePosition(1030);

brake(4)