Create Constants.c

Constants.c

This file contains all the constants used by subsystem functions, for example, the potentiometer readings at the arm’s upper and lower limits and the conversion factor between inches and drivetrain encoder counts.  Instead of hard-coding these numbers in the functions, they all reference here so that they can be tweaked easily.  

The arm limits are a special case, since these are the only numbers that are different for the two robots (due to the potentiometers not lining up exactly).  The limits are defined separately for the two robots.  In Pre-Auton, the code reads the value of digital I/O port 1.  If it finds a  jumper clip, the robot decides it is Alive and sets the limits to the Alive ones.  Otherwise, the robot assumes it is Dead and sets the Dead limits.