Programming is a set of instructions that the computer follows to control a process. For example, a recipe is a ‘program’ for cooking something. If you have all the proper ingredients and equipment, then follow the recipe’s instructions, you should get an edible treat.
In robotics, programming is what controls the robot. There are two parts to programming a robot for a FIRST competition. There is an autonomous part where actions are completely done by the robot without any assistance or input from drivers. Then there is the tele-operated part, where driver’s use a control board to send signals by radio to the robot to direct its actions. Both autonomous and tele-op require programs.
Programs interact with or control the physical parts of the robot. Programs send output signals to switches to turn parts on or off or may increase or decrease power to a motor to change speeds. Programs also read input signals. Input comes from sensors that look for a specific condition. For example a rotation sensor can read how many turns a wheel takes. That value can be compared to a value in the program and when it matches an action could be started or stopped. This is one way to make the robot travel a specific distance. Tele-op uses input from the radio connection to the driver controllers to initiate programs that control the robots actions.
Programs follow what is called a logic path. It can be a straight or sequential path, or it may divide or even loop in a circle. One way a program path divides is to use a true/false statement. This is where the program looks for a specified condition (like the value from a sensor). If the condition matches the one looked for then it is ‘true’ and the program continues on the ‘true’ path. If it does not match, then the program continues on the ‘false’ path. When logic paths circle, it is called a loop, or while loop. This is when a set of commands is repeated until a condition is met, then it continues.