/* orient.c */ #define DEBUG 1 #define LED_PORT_1 3 #define LED_PORT_2 4 #define LED_PORT_3 2 #define LED_PORT_4 24 #define LED_PORT_5 6 #define LED_PORT_6 31 #define LED_PORT_7 29 #define LED_PORT_8 5 /* LED_PORT_8 unused */ #define START_SENSOR 26 #define BACK_RIGHT 13 #define BACK_LEFT 14 #define FRONT_RIGHT 11 #define FRONT_LEFT 12 #define START_BUTTON 20 #define STOP_BUTTON 18 #define SAMPLES 5 #define LEDS 8 /* motor.c */ #define LEFT_MOTOR_1 0 #define LEFT_MOTOR_2 1 #define RIGHT_MOTOR_1 2 #define RIGHT_MOTOR_2 3 #define ROLLER_MOTOR 5 #define RIGHT_ENCODER 7 #define LEFT_ENCODER 8 #define FULL_SPEED 100 #define THREE_QUARTERS_SPEED 75 #define HALF_SPEED 50 #define QUARTER_SPEED 25 #define OFF 0 #define SPEED_FULL 100 #define SPEED_5_6 83 #define SPEED_2_3 66 #define SPEED_1_2 50 #define SPEED_1_3 33 #define SPEED_1_6 15 #define SPEED_OFF 0 #define RIGHT_TICKS 14 #define LEFT_TICKS 14 #define BACKWARD_TICKS_RIGHT 29 #define BACKWARD_TICKS_LEFT 29 #define RIGHT_VEER 4 #define LEFT_VEER 4 #define SLEEP_TIME 0.02 #define STEP_BACK_SLEEP_TIME 0.70 #define STEP_FORWARD_SLEEP_TIME 0.5 /* linefollow.c */ #define MODULUS 5 int front_right = 0; int front = 0; int front_left = 0; int back_right = 0; int back_left = 0; int center_left = 0; int center_right = 0; int action = 0; /* keeps the direction it moved in linefollow */ void readSensors() { front = isBlue(LED_PORT_5); front_right = isBlue(LED_PORT_6); front_left = isBlue(LED_PORT_7); back_right = isBlue(LED_PORT_4); back_left = isBlue(LED_PORT_3); center_right = isBlue( LED_PORT_1); center_left = isBlue( LED_PORT_2); }