Visual Studio Code
3 minute read
Set-up Remote Development:
After installing Visual Studio Code
the first step is to install the Remote Development
extension:
Remote Development
, allows you to use a remote machine as full-feautured development environment.
Inside the primary side bar
per default on the left side of your main menu
, press
Extensions(Crtl+Shift+X)
.
-
Inside the EXTENSIONS tab use the search
Extensions in Marketplace
to find the following extension:Remote Development
. -
Press
install
, to install theRemote Development
to your local machine.
Your local machine extensions are now installed!
-
With
Remote Development installed
, inside theprimary side bar
an itemREMOTE EXPLORER
is added, press to open. -
Inside the
REMOTE EXPLORER
selectSSH TARGETS
pressAdd New
.
- Enter SSH Connection Command:
ssh admin@192.168.2.100
, pressEnter
to confirm. - Select SSH configuration file to update:
/home/username/.ssh/config
(To update your config locally, use/etc/ssh/ssh_config
to update remote.).
Right click
on192.168.2.100
, pressConnect to Host in Current Window
.
- Enter password for $admin@192.168.2.100:
vectioneer
, pressenter
. - In the bottom bar in green you see
SSH:192.168.2.100
, this means that the connection is established: - The
EXPLORER Window
is now opend:
- With the
remote device connected
you can install theC/C++
andMotorcortex Template
extensions to your remote controller:
- Press:
install in SSH:192.168.2.100
.
Your controller has all extensions installed and is connected with Visual Studio Code!
Create and build a Motorcortex Project:
- Inside
EXPLORER
underNO FOLDER OPENED
connect to remote, pressOPEN FOLDER
, selecthome/admin/
pressOK
.
- This opens in
EXPLOROR
Window ->ADMIN[SSH:192.168.2.100]
.
-
Inside ADMIN[SSH:192.168.2.100], Press
New Folder...
to create a new folder, Enter name:Test
. -
Use keyboard shortcut
ctrl+shift+p
, search for:File: Open Folder...
, enter:/home/admin/Test
-> pressOK
.
- Enter password for $admin@192.168.2.100:
vectioneer
, pressenter
.
- Inside this folder create a new Motorcortex Project, use keyboard shortcut
ctrl+shift+p
, search forMotorcortex Create Project
.
- Name your Motorcortex project, for exampje:
Test
. - Now your project is visual in the
EXPLORER
it should look like this:
- This project inside
TEST[SSH:192.168.2.100]
, usesCMake
to build, for this you have to assign the following kit:
- Use keyboard shortcut
ctrl+shift+p
, search forCMake: Select a Kit
. - Select a Kit for Test:
GCC 9.3.0 x86_64-mcx-linux
. - In the bottom bar in blue
GCC 9.3.0 x86_64-mcx-linux
, this will show you which kit is active:
- Now you can try to build your program on the controller, go to
top menu bar
-> pressRun
-> pressRun Without Debugging
.
Your Motorcortex program is now running on you controller!
Add Motorcortex Module to Motorcortex Project:
- Inside your Motorcortex Project, use keyboard shortcut
ctrl+shift+p
, search forMotorcortex Create Module
.
- Fill in the name of your file, example
test
: - Fill in the name of your class, example
testClass
:
- You have created your Motorcortex Module:
Your Motorcortex Module is now added to your Motorcortex Project!