In our class, we will almost exclusively be using the standard CLAWBOT setup (image shown below).
Every time we write code that will be used to control our robot, we need to include the line of code below. This line of code sets up all of the motors and sensors with clear names.
#pragma config(StandardModel, "RVW CLAWBOT")
An image of this is shown below.
This line of code is similar to #include "stdio.h" in your other C programming. As we discussed earlier, #include "stdio.h" includes a standard library of input and output functions such as "printf" and "scanf". In RobotC, #pragma config(StandardModel, "RVW CLAWBOT") does the similar job of including a standard library of functions and set-up. Some of the main parts of this setup are defining which ports each motor is plugged into, and giving them names such as "leftMotor" and "rightMotor".
CLAWBOT motors are set up as follows:
CLAWBOT analog sensors are set up as follows: