Lab 2

Arduino Code for Lab 2 Outside Track Scenario:


//All motors set to 25% power
motorSpeed(4,25);

//Previous command for 2 seconds
goFor(2);

//All motors set to 20% power
motorSpeed(4,20);

//The vehicle goes to 393 marks relative to the starting position
goToAbsolutePosition(393);

//Reverse all motors
reverse(4);

//All motors set to 30% power
motorSpeed(4,30);

//Previous command for 1.5 seconds
goFor(1.5);

//Brake all motors
brake(4);