Lab 8

Arduino Code for Lab 8 Outside Track Scenario:

 

//Reverses all motors

reverse(4);

 

//Sets all motors to 25% power

motorSpeed(4,25);

 

//Tells the AEV to go 350 marks from the beginning

goToAbsolutePosition(350);

 

//Tells the AEV to reverse the motors

reverse(4);

 

//Tells the AEV to set all the motors to 50% power

motorSpeed(4,50);

 

//Tells the AEV to run the previous command for 0.5 seconds

goFor(0.5);

 

//Tells the AEV to brake all motors

brake(4); //in front of sensor at this point

 

//Tells the AEV to do the previous command for 9 seconds

goFor(9);

 

//Tells the AEV to reverse all motors

reverse(4);

 

//Tells the AEV to set all the motors to 25% power

motorSpeed(4,25);

 

//Tells the AEV to go 100 marks from the current position

goToRelativePosition(100);