Lesson 4.1 - Common PROS and Terminal Commands
Important Terms
CMD: Abbreviation for Command Prompt. To open CMD, press the Windows Key and X at the same type, and the menu containing “Command Prompt” should appear in the bottom left corner of the screen.
Terminal: Interchangeable with CMD / Command Prompt.
VSCode: abbreviation for Visual Studio Code (it might actually be named just "Code" on your computer. It should have a blue, not purple, icon).
Path: this is essentially the location to something (like a folder) in your computer. We explain how to obtain the absolute path of any folder through file explorer in the section "Creating a New PROS Project"
Useful Terminal Commands (For CLI Users)
pwd Typing this in the terminal will let you view what your "working directory" is. The reason this is important is because "relative paths" are frequently used in the world of computers. A relative path is where things are located relative in the file tree from where you currently are in the computer’s file tree (pwd)
ls Typing this in the terminal will generate a list of all directories (folders) in your current directory.
cd <PATH> Stands for "change directory." Typing this in the terminal will change your current working directly to the <PATH> argument. For example, if I wanted to change my current working directory to “Documents” I would type cd Documents
_______________________________________________________________________
Commands
After verifying that the PROS CLI was successfully installed by typing “prosv5 --version” into your command prompt, here are must know PROS commands
Creating a New PROS Project
prosv5 conduct new-project <PATH> v5
<PATH> is the path of the folder in which you want the PROS Project to be created. Open the folder you wish to have the PROS project in File Explorer. Click here, and the Path will appear as text. Copy that down and paste that instead of <PATH>
For example, if Bob wanted his PROS project to be in Documents in a folder named “Ex-6-11-project,” this is what it would look like:
Building your PROS Project
Building is how you would check for syntax errors when drafting code (syntax errors are kind of like code grammar errors. If you mistype how the “grammar” of how the code is written, the code will not build since the compiler has trouble understanding the “grammar” errors).
There are two ways to go about this. We recommend the second method if you are not comfortable with using CMD / Terminal.
cd to your PROS Project. Type prosv5 make . If it worked, it should say “make: Nothing to be done for quick.” In layman's terms, no modifications have been made to any files so they are not building the project.
IF THERE IS AN ERROR and it says something along the lines of “Not in a PROS Project,” your current working directory (you can check this by typing pwd) is not correct. Most likely, it is the parent of the folder with the PROS project. Type ls to generate a list of the folders within your current directory. cd to the name of the folder that is in the list. Now try prosv5 make once again.
Open the PROS Project in the Visual Studio Code editor. To do this, click “File” in the left hand top corner, click “Open Folder,” and then you will be prompted to choose the folder you want to open, which would be the PROS Project. If it worked, it should say “make: Nothing to be done for quick.” In layman's terms, no modifications have been made to any files so they are not building the project.
Once the PROS Project is opened, on the left hand side at the top of the code editor, there should be something called “Terminal.” Click “Open New Terminal.” Then, you can type prosv5 make
IF THERE IS AN ERROR and it says something along the lines of “Not in a PROS Project,” your current working directory (you can check this by typing pwd) is not correct. Most likely, it is the parent of the folder with the PROS project. Type ls to generate a list of the folders within your current directory. cd to the name of the folder that is in the list. Now try prosv5 make once again.
Uploading a New PROS Project
If you haven’t viewed the explanation on prosv5 make we recommend going back to that section as the procedure for uploading is very similar. Also, you should be building your project using the “make” command just specified before you decide to upload.
In your Command Prompt / VSCode terminal, type prosv5 upload --slot <SLOT NUM>. <SLOT NUM> is any number between 1 through 8 as the V5 Brain can hold up 8 programs at a time. For example, if I wanted to upload to slot 3, I would type prosv5 upload --slot 3
NOTE: If you simply type prosv5 upload with no slot specified, it will automatically upload to program slot 1 in the brain.
NOTE: If you type prosv5 mu it will first make the project and then upload the project all in this one command. Once again, specifying the slot using “--slot <SLOT NUM” is optional. It will default to uploading in program slot 1.
Verbose (Allows Printing to Terminal)
At the time that this section was written, this command will only work if your computer is directly plugged into the brain via MicroUSB. However, there is a chance it may change by the time the article gets published (we will update this section whenever we get the chance).
Type prosv5 terminal when the program is running will allow for anything to be printed to the computer. This command is especially useful for debugging (printing sensor values, logic, etc.)
If you get an unexpected error about COM Ports, try (1) unplugging and replugging the MicroUSB cable (2) plug the cable into a different USB port.