Introduction to Robot C
The purpose of this activity was to introduce ourselves to the layout and syntax of robot c, the programming language that is used by the vex robotics kits. We learned a lot about the program's quirks and about how it works as well as what each of the sensors does and how to control them. Below you can find two samples of my group's programming. Please note that all programs were run on a test bed that contained all of the sensors in our vex robotics kits.
The program above sets the value of the global variable brightest to the value of the light sensor. The limit switch resets the value of brightest.
This program rotates the motor 20 times in each direction using the limit switch to stop rotation in one direction and a 0.5 second timer to stop rotation in the opposite direction.