The purpose of the exercises 3.1.1 through 3.1.6 was to help us gain an understanding of the applications of RobotC programming. We used many different VEX parts and various methods of programming through RobotC to cause the VEX parts to function. I learned a lot about the way RobotC programming works from what I never learned in 8th grade and I learned a lot about the actual functions different VEX parts and RobotC functions have.
3.1.5 Program
In this program, we had a variable, brightest, which changed based on the brightest value and saved that value until it registered a value that was higher than the value of brightest.
The program cycles, if the limit switch is pressed it sets the variable "brightest" as 0, then while the bump switch is not pressed, if the light sensor value is greater than the value of "brightest," then the value of "brightest" changes to the value of the light sensor.
3.1.6 Program
This program spins a gear in one direction until it hits the limit switch, then turns the other way for .5 seconds and turns the other way once again. This cycle continues 20 times.
Within this program, we had to work a lot on the location elements, such as the location of "counter++," which, while misplaced, caused our counter to increase rapidly and only physically move 3 times. But when placed correctly, the counter increased when it should have and at the correct rate.