First Test Code
// Program between here——————————————————————-
celerate(4,0,25,3);
goFor(1);
motorSpeed(4,20);
goFor(2);
reverse(4);
motorSpeed(4,25);
goFor(2);
brake(4);
// And here——————————————————————————–
} // DO NOT REMOVE. end of void myCode()
Reflectance Sensor Test
reflectanceSensorTest();
External Sensors Outside
motorSpeed(4,35);
goFor(2);
motorSpeed(4,35);
goToAbsolutePosition(295);
reverse(4);
motorSpeed(4,35);
goFor(1.5);
brake(4);
goFor(2);
motorSpeed(4,35);
goToAbsolutePosition(295);
reverse(4);
motorSpeed(4,35);
goFor(1.5);
brake(4);
Program Basics
celerate(1,0,15,2.5); //accelerate motor 1 from 0 – 15 % in 2.5 seconds
goFor(1); // move at 15% for second
brake(1); // brake motor 1
celerate(2,0,27,4); //accelerate motor 2
goFor(2.7); //go for 2.7 seconds
celerate(2,27,15,1); //decelrate motor 2
brake(2); //brake motor 2
reverse(2); //reverse motor 2
celerate(4,0,31,2); //accelerat both motors
motorSpeed(4,35);
goFor(1);
brake(2);
goFor(3);
brake(4);
goFor(1);
reverse(1);
celerate(1,0,19,2);
motorSpeed(2,35);
goFor(2);
motorSpeed(1,19);
goFor(2);
celerate(4,19,0,3);
brake(4);
goFor(1); // move at 15% for second
brake(1); // brake motor 1
celerate(2,0,27,4); //accelerate motor 2
goFor(2.7); //go for 2.7 seconds
celerate(2,27,15,1); //decelrate motor 2
brake(2); //brake motor 2
reverse(2); //reverse motor 2
celerate(4,0,31,2); //accelerat both motors
motorSpeed(4,35);
goFor(1);
brake(2);
goFor(3);
brake(4);
goFor(1);
reverse(1);
celerate(1,0,19,2);
motorSpeed(2,35);
goFor(2);
motorSpeed(1,19);
goFor(2);
celerate(4,19,0,3);
brake(4);
Battery Testing
void myCode()
{
//Battery Test Code
celerate(4,0,20,3);
goFor(3);
celerate(4,20,35,1);
brake(4);
reverse(4);
motorSpeed(4,10);
goFor(1);
brake(4);
celerate(4,0,20,2);
goFor(3);
brake(4);
reverse(4);
motorSpeed(4,10);
goFor(1);
brake(4);
}
Motor Configuration
void myCode()
{
//Motor configuration programming
//2-20-18
//check both motors functionality
reverse(4);
celerate(4,0,25,2);
goFor(3);
celerate(4,25,0,2);
brake(4);
reverse(4);
celerate(4,0,25,2);
goFor(3);
celerate(4,25,0,2);
brake(4);
}
Performance Test 1
void myCode()
{
//PerformanceTest1Code
//move from starting dock to top of hill
//brake motors and drift to the first sensor
motorSpeed(4,35);
goToAbsolutePosition(-203);
brake(4);
goFor(12);
motorSpeed(4,28);
goToRelativePosition(-35);
brake(4);
}
Performance Test 2
void myCode()
{
//PerformanceTest2Code
//move from starting dock to top of hill
//brake motors and drift to the first sensor
motorSpeed(4,35);
goToAbsolutePosition(209);
brake(4);
goFor(11);
motorSpeed(4,30);
goToAbsolutePosition(443);
brake(4);
//wait at loading zone
goFor(13);
reverse(4);
motorSpeed(4,40);
goFor(2);
brake(4);
}
Final Performance Test
void myCode()
{
//FinalPerformanceTestCode-Used in Evaluation
//move from starting dock to top of hill
//brake motors and drift to the first sensor
motorSpeed(4,35);
goToAbsolutePosition(225); //originally 210
brake(4);
goToAbsolutePosition(290);
reverse(4);
motorSpeed(4,35);
goFor(.5);
brake(4);
reverse(4);
//wait for gate to open
goFor(8);
motorSpeed(4,29);
goToAbsolutePosition(446);
brake(4);
//wait at loading zone
goFor(12);
reverse(4);
//go uphill with load
motorSpeed(4,37);
goToAbsolutePosition(425); //419 < x < 429
brake(4);
goToAbsolutePosition(362);
reverse(4);
motorSpeed(4,40);
goFor(1);
brake(4);
reverse(4);
goFor(7);
//speed through gate, stop 2 feet after gate
motorSpeed(4,50);
goToAbsolutePosition(285);
brake(4);
//motor braking
goToAbsolutePosition(147);
reverse(4);
motorSpeed(4,25);
goToAbsolutePosition(49);
brake(4);
}