Hi everyone,
I am trying to switch from RobotC to PROS for the upcoming V5. I have downloaded and installed the PROS add-on for Atom, but I personally hate Atom, so I am trying to change to VS Code, my main editor for everything else. I don’t have a lot of knowledge on the way paths and system variables and whatnot work but I think setting up all these things involves modifying those. I basically want to get rid of having to use Atom at all and only use VS Code. Could somebody explain to me a little bit about how to be able to work with PROS in VS Code and explain why that works so I can learn a bit more about computers.
Luckily for you, there is also a PROS CLI (Command-Line-Interface). With the more recent VS Code, you can open it up, go to the integrated terminal, change your directory to that of the folder you wish your project to be in, and run
pros conduct new
to make a new project. Then you can just set that folder to be your workspace and VS Code automatically implements the nice autofill features that Atom has. To compile and download your files, you can run
pros mut
in the terminal.
Hope this helps and if I got something wrong someone please correct me
So I just did that and it created a project, but there isn’t an actual project file/folder there. I know other IDE’s that create a project file. Does PROS not do this? Also, how do I only compile the program and see what errors there are? I tried
pros make
but that just resulted in:
PS C:\Singh\VexRobotics\VEXTurningPoint\Programs> pros make
Invoking make in C:\Singh\VexRobotics\VEXTurningPoint\Programs...
Makefile:70: target 'Drive' doesn't match the target pattern
Makefile:70: target 'Full' doesn't match the target pattern
Makefile:70: target 'Control' doesn't match the target pattern
make[1]: Nothing to be done for 'all'.
CC -I./include -I./src
arm-none-eabi-gcc -I./include -I./src -c -Wall -mthumb -mcpu=cortex-m3 -mlittle-endian -mfloat-abi=soft -Os -ffunction-sections -fsigned-char -fomit-frame-pointer -fsingle-precision-constant -std=gnu99 -Werror=implicit-function-declaration -o Drive
arm-none-eabi-gcc.exe: fatal error: no input files
compilation terminated.
make: *** [Makefile:72: Drive] Error 1
PS C:\Singh\VexRobotics\VEXTurningPoint\Programs> pros make
Invoking make in C:\Singh\VexRobotics\VEXTurningPoint\Programs...
Makefile:70: target 'Drive' doesn't match the target pattern
Makefile:70: target 'Full' doesn't match the target pattern
Makefile:70: target 'Control' doesn't match the target pattern
make[1]: Nothing to be done for 'all'.
CC -I./include -I./src
arm-none-eabi-gcc -I./include -I./src -c -Wall -mthumb -mcpu=cortex-m3 -mlittle-endian -mfloat-abi=soft -Os -ffunction-sections -fsigned-char -fomit-frame-pointer -fsingle-precision-constant -std=gnu99 -Werror=implicit-function-declaration -o Drive
arm-none-eabi-gcc.exe: fatal error: no input files
compilation terminated.
make: *** [Makefile:72: Drive] Error 1
I’ll make a more detailed guide later, but here’s the general process.
- Using any terminal you want, make a new PROS project anywhere you want (
pros conduct new <directory>
where does not yet exist and is where you want your code).
2. Make sure you have the C/C++ plugin (by Microsoft) installed in VSCode.
3. Open
<directory>
from step 1 in VSCode.
4. VSCode should create a
<directory>/.vscode/
folder (don’t remember if this was 100% automatic or if VSCode had to be encouraged to do it).
5. You have to edit one of the files inside
.vscode/
to point to the
gcc
toolchain installed by PROS.
6. You can edit another file to setup tasks to run typical PROS CLI commands (compile, upload, debug terminal, etc.).
7. You can edit a third file to assign keyboard shortcuts to your tasks.
Sorry I don’t remember the exact filenames for 5-7.
The .vscode file should be a c_cpp_properties.json.
In addition to setting up tasks, you can find VSCode Extensions that add buttons and labels that can also run terminal commands.
Sorry for sounding dumb, but where is the gcc file. I assume it should be a .exe file since that’s what the default is in that file that @OscarMNOVA12 mentioned, so I looked in the PROS directory that was created but I didn’t find any gcc.exe file. I found a bunch of pdfs explaining things about the gcc, but nothing about where it is located.
gcc wouldn’t be in the .vscode directory, it’d be in some system folder on your machine. On a mac, I’d check /usr/bin. On Windows, not sure where it’d be.
Sorry should have clarified. I checked in the PROS directory that was downloaded when I got the PROS system from the website. I didn’t look in the .vscode folder. It was in Program_Files
When I made a workspace I didn’t have to modify any files. I had the C/C++ extension and it autocompleted out of the box
I’m having trouble on the first step. I’m trying to create a new document using ‘pros conduct new ’. The terminal I’m using is the windows command prompt. It keeps telling me ‘pros’ isn’t recognized as an internal or external command, operable program, or batch file. Also I only downloaded the CLI, if that helps.
Make sure your
Path
environment variable points to the directory with the
pros.exe
executable within (usually
C:\Program Files\PROS\cli-64
).
If you are using PROS 3, the executable is named
prosv5
.
Yes.
Just to tack on, we’re planning on making pros
the default command for the CLI around December/January as we expect the new environment to have settled out and we expect fewer folks to be using the old CLI (2.x.x).
Right now I’m doing
prosv5 conduct new <./TP_2018-2019_Code>
I keep getting the error “The syntax of the command is incorrect.” I think I did something wrong with the syntax of the part, but I’m not sure.
Remove the carets (‘<>’). You don’t need the ‘./’ either.
+1
Yeah, that was the problem
For those switching exclusively to PROS 3 before then, I would recommend just creating a symbolic link/shortcut from ‘pros’ to ‘prosv5’.
Ok, so now I’m about to try to download something using PROS in VSCode. A simple drive program for now. Do I need to download any firmware or do any setup on the cortex, or can I just simply download the program. I assume I need to download some files for setup but I’m not sure.
EDIT: To be clear, I am still testing this on Cortex. I will work on V5 once I get the parts.