/*Constants*/ 

#define SENSOR_COUNTS_PER_REV 16
	
#define SERVO_MIN 1000 /*minimum angle assigned to servo*/

#define SERVO_MAX 4000 /*maximum angle assigned to servo*/

#define LOAD_MSG "\n\nLoad missle"
 /*Configs*/
 
#define INIT_LOOP_SLEEP_TIME 1.0

#define INIT_LOOP_COUNT 5

#define MOTOR_NUMBER 3

#define MOTOR_POWER 100

#define SENSOR_COUNT &lego3_counts /*the variable in which the amount of rotations is stored*/

#define SENSOR_VELOCITY &lego3_velocity /*the variable in which the velocity of the angle sensor is stored*/

#define SENSOR_COUNT_FIRE 46*SENSOR_COUNTS_PER_REV + 13 /*rotational count at which the servo is activated and pencil is fired*/

#define SENSOR_COUNT_STOP 52*SENSOR_COUNTS_PER_REV + 0 /*rotational count at which the robot stops*/

#define SENSOR_COUNT_RESET 0*SENSOR_COUNTS_PER_REV

#define SERVO_FIRE_POSITION SERVO_MAX - 1000 /*position to which the servo goes to when pencil is fired*/

#define SERVO_RESET_POSITION SERVO_MIN + 1000 /*position at which servo is at when launcher is to be loaded*/

#define SERVO &servo0 /*the assigned servo that functions as a trigger*/

#define SERVO_DELAY 0.0 /*the time delay because of sevo lag*/

/*Global Variables*/ 

int startPID;	
int stopPID;
int runPID;
int stopped = 0;
int running = 0;

