-
Notifications
You must be signed in to change notification settings - Fork 0
VRC | Programming Environment
One of the official programming software for VRC is called RobotC, a programming language derived from a popular programing language, known as "C". RobotC allows users to easily initialize, synthesize, and analyze programs designed for VEX EDR robots. From this section of the Wiki, you will learn the basics of RobotC and how use it with the physical VEX Cortex.
RobotC, as stated above, is used to initialize, synthesize, and analyze programs. A photograph of the main interface can be seen below.
RobotC allows users to open up programs created by the RobotC. Many files can be opened at once through a single window. The different files are shown as separate tabs, analogous to the different tabs internet browsers have. The UI, or user interface, allows users to open windows or perform certain actions in many ways. Users can perform an action using the top menu bar using the separate "File", "Edit", "View", "Robot", "Window", and "Help" menus. Alternatively, users can perform actions by using the ribbon menu, which holds the familiar icons such as "Save", "Save as", and "Open file" in addition to the unfamiliar icons such as "Motor and Sensor Setup", "Firmware Download", "Compile Program", and "Download to Robot". The "Motor and Sensor Setup" button allows students to connect VEX Motors with a computer program. In the computer program used to control the robot, the VEX Motor is called a certain name. Students use the "Motor and Sensor Setup" button to connect the name of the VEX Motor with the actual VEX motor. "Firmware Download" downloads the latest updates to the RobotC program and firmware updates to the VEX Robot. The "Compile Program" button allows the computer to compile the program. During this process, the computer processes the code (if there is an error in the code, the compiling will fail) and convert it into a usable format that the robot cortex is able to understand. After the computer program is compiled, users are then able to press the "download to robot" button to download the program to the robot.
Users will be able to synthesize different RobotC programs; each separate program is usually designed for a different robot. Each program contains lines of code that are used to control the VEX Robot's every move and action. For example the following line of code, or command "startMotor(Motor1, 64)" sets a motor called "Motor1" to the speed of "64". But who tells Motor1 to rotate at the speed of "64"? In fact, the VEX Cortex coordinates the robot's activities by reading the commands that the student wrote; you will learn more about as the reader reads the article.
The ability to analyze programs is vital for any programer to learn and master. Often enough, discrepancies in the program, also known as bugs, can be discovered while the program is running. It is important to fix these bugs to ensure a working robot that obeys all commands without error. RobotC includes a built-in debugger, allowing programmers to analyze sensor readings in addition to analyzing the program's response to the sensor information. If there is an error between the sensor reading and the program reaction, the user must fix the error and prevent future errors from occurring again. Sometimes, the program needs to be proofread multiple times to maximize the preventability of bugs.
At the current time, students are not able to download RobotC to their home computers. This is because RobotC is a paid software that is bundled with VRC equipment that is bought by the team. Because of this, it is imperative that programmers can efficiently program their programs while using the school computers.
Once RobotC opens up, you will be greeted with a similar screen shown above. Click on the 'New' button, located on the menu bar, to create a new file. Make sure to save the file.
Once a new file is created, you will be able to see the program code. Currently, there are seven lines of code.
First, the RobotC must be configured so it deals with VEX EDR robots, rather than VEX IQ robots. To do this, click on 'Robot' on the main menu header. Then, click on 'Platform Type' and hover over 'VEX Robotics'. Be sure to select 'VEX 2.0 Cortex'. Once that is complete, then perform the same actions, but click on 'Natural Language PLTW'.
Programmers can use a number of commands to control their robot. Once these commands are known, programming the Robot is faster and more efficient. A few internet guides can be found using the following links: