Programming Basics

R&D2 code

   motorSpeed(1,30);

//motor 1 at 30 % power

  goToRelativePosition(-250);

//go a relative distance of 250 marks

  brake(1);

//power cut from motor 1

 

R&D3 code (is everything below this)

35%

 motorSpeed(1,35);

//motor 1 at 35 % power

 goToRelativePosition(-292);

//go a relative distance of 292 marks

 brake(1);

//power cut from motor 1

 goFor(7.5);

//run motor 1 for 7.5 seconds

 motorSpeed(1,35);

//motor 1 at 35 % power

 goToRelativePosition(-312);

//go a relative distance of 312 marks

 brake(1);

//power cut from motor 1

 goFor(5);

//run motor 1 for 5 seconds

 reverse(1);

//reverse motor direction

 motorSpeed(1,35);

//motor 1 at 35 % power

 goToRelativePosition(50);

//go a relative distance of 50 marks backwards

 brake(1);

//power cut from motor 1

 

40%

 motorSpeed(1,40);

//motor 1 at 40 % power

 goToRelativePosition(-292);

//go a relative distance of 292 marks

 brake(1);

//power cut from motor 1

 goFor(7.5);

//run motor 1 for 7.5 seconds

 motorSpeed(1,40);

//motor 1 at 40 % power

 goToRelativePosition(-312);

//go a relative distance of 312 marks

  brake(1);

//power cut from motor 1

  goFor(5);

//run motor 1 for 5 seconds

  reverse(1);

//reverse motor direction

  motorSpeed(1,40);

//motor 1 at 40 % power

  goToRelativePosition(50);

//go a relative distance of 50 marks backwards

  brake(1);

//power cut from motor 1

 

45%

 motorSpeed(1,45);

//motor 1 at 45 % power

 goToRelativePosition(-292);

//go a relative distance of 292 marks

 brake(1);

//power cut from motor 1

 goFor(7.5);

//run motor 1 for 7.5 seconds

 motorSpeed(1,45);

//motor 1 at 45 % power

 goToRelativePosition(-312);

//go a relative distance of 312 marks

  brake(1);

//power cut from motor 1

  goFor(5);

//run motor 1 for 5 seconds

  reverse(1);

//reverse motor direction

  motorSpeed(1,45);

//motor 1 at 45 % power

  goToRelativePosition(50);

//go a relative distance of 50 marks backwards

  brake(1);

//power cut from motor 1

 

CABOOSE TEST

 reverse(1);

//reverse direction of motor 1

 motorSpeed(1,45);

//motor 1 set to 45 power

 goToRelativePosition(400);

//go to relative mark of 400

 brake(1);

//cut power from motor 1

 

 reverse(1);

//reverse direction of motor 1

 motorSpeed(1,40);

//motor 1 set to 40 power

 goToRelativePosition(400);

//go to relative mark of 400

 brake(1);

//cut power from motor 1

 

 reverse(1);

//reverse direction of motor 1

 motorSpeed(1,35);

//motor 1 set to 35 power

 goToRelativePosition(400);

//go to relative mark of 400

 brake(1);

//cut power from motor 1

 

Final Performance test

Labroom  

 motorSpeed(1,45);

 goToRelativePosition(-282);

 brake(1);

 goFor(7);

 motorSpeed(1,40);

 goToRelativePosition(-303);

 brake(1);

 goFor(5);

 reverse(1);

   motorSpeed(1,40);

   goToRelativePosition(268);

   brake(1);

   goFor(7.5);

   motorSpeed(1,40);

   goToRelativePosition(324);

   brake(1);

 //

 

Classroom

 motorSpeed(1,45);

 goToRelativePosition(-282);

 brake(1);

 goFor(7);

 motorSpeed(1,40);

 goToRelativePosition(-303);

 brake(1);

 goFor(5);

 reverse(1);

 motorSpeed(1,40);

 goToRelativePosition(268);

 brake(1);

 goFor(7.5);

 motorSpeed(1,40);

 goToRelativePosition(324);

 brake(1);

 //