Will stop the robot after x inches have been traveled Stops if robot gets within x inches of an object The third parameter (power level) is optional. Function requires two parameters: degrees and radius. Turns a specified number of degrees in an arc with a specified radius. Function requires at least two parameters: direction and degrees. Need to specify whether the robot should follow If no distance is specified, use one of the "stop" or "until" functions to stop the robot.įollows a line. Optional parameters include distance and power level. If no distance is specified, use one of the "stop" or "until" functions to stop the robot.ĭrives backward. Sets the level of power for the global variable called "powerLevel"ĭrives forward. If the motors are reversed or placed upside-down in the robot, you can change this to BACKWARD.Īllows you to calibrate light sensors within the program The default direction of Motors is FORWARD. The default gear ratio is 1 (if not specified). Optional parameters are Gear Ratio and Direction of Motors. Initializes the global variables and sensorsĪllows for robot of specified dimensions. If you end up with an error message when you press the F5 or F7 key, read the message to try to understand what it is telling you.įor an explanation of common error messages, click here. If you are curious about what the Library2012.c "include" file looks like, click here. This is why each of the examples at the bottom of this page include a reference to "#include Library2011.c". The Pseudocode statements below are interpreted (compiled) by RobotC through the use of a library of functions stored in a single "include" file. (such as distance, power level, degrees, or side) is required which gives further instructions to the robot. The Pseudocode used here is an extension of the RobotC language.Īll Pseudocode statements below require a set of parentheses followed by a semi-colon. Our goal when developing pseudocode will be to identify and organize the simple behaviors a robot Important details of your program without having to worry about the less relevant parts getting in your way. Pseudocode is a sort of halfway language between English and computer code. Pseudocode programs in RobotC The Pseudocode for the Spring 2012 season is as follows: