/* Uses calibrate.c orient.c moving.c sensors.c strategy.c test_Yao.c*/ void main() { int direction; runrobot(); } /* Testing calibration */ void runrobot() { int direction; activate_robot(); calibrate(); direction = orientation(); /* 0 = forward, 1 = left, 2 = back, 3 = right */ if (direction == 0) { turnleft90(); direction++; } else if (direction == 2) { turnleft90(); direction++; } gethackers(direction,80); getprofessor(direction,80); forward(50); whileencoders(1,100); frontarmup(); forwarduntilbumper(1,100); if (direction == 1) wallturn90(2,-60); else { backabit(); turnright90(); /* wallturn90(1,-60); wallturn90(1,-60);*/ } backwarduntilbumper(0,50); forwarduntilbumper(1,80); if (direction == 1) wallturn90(2,-60); else { wallturn90(1,-60); } backarmup(); if (direction == 1) forwardslightright(100); else forwardslightleft(100); whileencoders(1,1200); backward(100); whileencoders(2,800); if (direction == 1) turnleft90(); else turnright90(); while(1) { forwarduntilbumper(0,100); backwarduntilbumper(0,100); } }