Lab 4 – External Sensors

Arduino Code

int marks= -344;              //-(14*12)/(3.902/8)=14ft

goFor(3); //delay before AEV starts moving

reverse(4); //reverses motors so they will go forward

motorSpeed(4,25); //sets all motors to 25% speed

goFor(2); //travels for 2 seconds

motorSpeed(4,20); //sets all motors to 20% speed

goToAbsolutePosition(marks); //keeps motors running until the 344 marks are counted

reverse(4); //reverses motor direction

motorSpeed(4,30); //sets all motors to 30% speed

goFor(1.5); //runs motors for 1.5 seconds

brake(0); //Stops all motors

Lab 4 Report