This is some of the code that I used in middle school to program the robot. It was Robot C, but it is now replaced by the Vex C++.
Emergency stop:
Detecting color:
Detect how far away a color is:
Gyro Sensor: