Installation and Updating¶
These steps are for VEXcode. Using PROS? See Using PROS.
Install¶
- Download and install Visual Studio Code
- Install the VEX Robotics Extension
- Open the Extensions view (Ctrl+Shift+X, or Cmd+Shift+X on a Mac)
- Search for and install "VEX Robotics Extension" by VEX Robotics
- Set up the project folder
- Download the latest
RW-Template.zipfrom Releases (not the "Source code" files) - Unzip it
- Open the resulting folder in VS Code
- Download the latest
Then follow the Quick Start.
Update from an older version¶
Open your project in VS Code, then:
- In the menu bar, click Terminal. On a Mac the menu bar is at the very top of the screen; on Windows and Linux it's at the top of the VS Code window (if you only see a ☰ icon there, click it first)
- Click Run Task...
- Pick Update RW-Template from the list
When it's done, build and download as usual.
Can't find the menu?
Press Cmd+Shift+P (Ctrl+Shift+P on Windows), type Run Task, press Enter, and pick Update RW-Template.
Projects from 4.0.0 and older don't have this task yet. Update them by hand once, then use the task after that.
The updater downloads the newest release and replaces RW's own files. It leaves your custom folder, your VS Code settings (apart from the update task itself) and any files you added alone. If you changed one of RW's files (say src/motor-control.cpp), it saves your copy in rw-backup/ first and tells you which files it saved.
New settings have defaults, so your custom folder keeps building. The updater lists the settings that are new in the version you got, so you can copy any you want to change into custom/src/robot-config.cpp. The release notes cover everything else that's new.
Updating without internet, or from the terminal
The task runs tools/update.ps1 on Windows and tools/update.sh on Mac and Linux, and you can run them yourself in VS Code's terminal. To update a laptop without internet, download RW-Template.zip on another computer, copy it over, and give the updater its path:
If Windows says running scripts is disabled, the laptop's settings block PowerShell scripts. Update by hand instead (below).
Projects from 4.0.0 and older¶
These don't have the updater yet, so update them by hand once:
- Download and unzip the new
RW-Template.zipas above, into a new folder. Don't unzip it over your old project:src/main.cppis nowsrc/vexcode/main.cpp, and an old copy left behind breaks the build - Copy your old project's
customfolder into the new project, replacing the one there - If the four
controller_1.Axislines inrunDriver()incustom/src/user.cppend in.value(), change them to.position()..value()goes up to 127 instead of 100, so the robot reached full speed with the stick only about 80% of the way over - Build. New settings have defaults, so an older
customfolder keeps building. Coming from 2.x? Also copy the four distance reset sensors (front_sensor,left_sensor,right_sensor,back_sensor) from the newcustom/src/robot-config.cppandcustom/include/robot-config.hinto yours, with any free ports if your robot doesn't have them - To use new features, copy the new parts of the template's
custom/src/user.cppandcustom/src/robot-config.cppinto yours
Warning
Updating replaces anything you change outside the custom folder. The updater saves your copies in rw-backup/, but updating by hand doesn't, so copy out anything you want to keep.