Skip to content

VRC | Programming Environment

Edwin edited this page Aug 28, 2017 · 11 revisions

Getting Started

One of the official programming software for VRC is known as RobotC, which is 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.

Hardware/Software Overview

RobotC

RobotC, as stated above, is used to initialize, synthesize, and analyze programs. A photograph of the main interface can be seen below. Photograph of the Application RobotC for VRC

Initialize

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". After reading the end of this article, you will be able to familiarize yourself with the unfamiliar buttons.

Synthesize

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.

Analyze

The analyzation of one's own program 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 discrepancies 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.

Installation

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 maximize the efficiency of their time spend in the Robotics Lab.

Commands

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:

Official RobotC Wiki
Unofficial Helpful PDFs

Version control and Git

Overview

Version control is not just limited to RobotC, but any project that involves tracking files that were modified multiple times in its lifetime. The El Segundo High School Robotics Club uses Git as a version control system. The website GitHub allows the club to use the Git version control system for free of charge, as long as all the files are public. Remember that GitHub is the website and Git is the version control system.

Git Commands

Git allows programmers to track and update different versions of the same file. Below are some common commands that programmers must learn how to use to be an efficient and effective programmer. This is by no means an exhaustive list, but an important list.

"git clone"

Fully clones a repository, or project from a particular website or database

"git status"

Determines the status of files in a repository and checks whether or not they are added to the repository or are updated

"git add"

Adds a file to a Git repository

"git commit"

Commits certain files by making the recently changed files ready for pushing to the database or website

"git push"

Causes the changes made to a program on the local computer to update on a database or website

"git pull"

Checks if there are any newer versions of a program on the database of website, and downloads said newer version of the program

Clone this wiki locally