Visual Studio Code

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).

  1. Inside the EXTENSIONS tab use the search Extensions in Marketplace to find the following extension: Remote Development.

    image not found

  2. Press install, to install the Remote Development to your local machine.

Your local machine extensions are now installed!

  1. With Remote Development installed, inside the primary side bar an item REMOTE EXPLORER is added, press to open.

  2. Inside the REMOTE EXPLORER select SSH TARGETS press Add New.

  • Enter SSH Connection Command: ssh admin@192.168.2.100, press Enter to confirm.
    image not found
  • Select SSH configuration file to update: /home/username/.ssh/config (To update your config locally, use /etc/ssh/ssh_config to update remote.).
    image not found
  1. Right click on 192.168.2.100, press Connect to Host in Current Window.
    image not found
  • Enter password for $admin@192.168.2.100: vectioneer, press enter.
    image not found
  • In the bottom bar in green you see SSH:192.168.2.100, this means that the connection is established:
    image not found
  • The EXPLORER Window is now opend:
    image not found
  1. With the remote device connected you can install the C/C++ and Motorcortex Template extensions to your remote controller:
    image not found
  • 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:

  1. Inside EXPLORER under NO FOLDER OPENED connect to remote, press OPEN FOLDER, select home/admin/ press OK.
    image not found
  • This opens in EXPLOROR Window -> ADMIN[SSH:192.168.2.100].
    image not found
  1. Inside ADMIN[SSH:192.168.2.100], Press New Folder... to create a new folder, Enter name: Test.

  2. Use keyboard shortcut ctrl+shift+p, search for: File: Open Folder..., enter: /home/admin/Test -> press OK.

    image not found

  • Enter password for $admin@192.168.2.100: vectioneer, press enter.
    image not found
  1. Inside this folder create a new Motorcortex Project, use keyboard shortcut ctrl+shift+p, search for Motorcortex Create Project.
    image not found
  • Name your Motorcortex project, for exampje: Test.
    image not found
  • Now your project is visual in the EXPLORER it should look like this:
    image not found
  1. This project inside TEST[SSH:192.168.2.100], uses CMake to build, for this you have to assign the following kit:
  • Use keyboard shortcut ctrl+shift+p, search for CMake: Select a Kit.
  • Select a Kit for Test: GCC 9.3.0 x86_64-mcx-linux.
    image not found
  • In the bottom bar in blue GCC 9.3.0 x86_64-mcx-linux, this will show you which kit is active:
    image not found
  1. Now you can try to build your program on the controller, go to top menu bar -> press Run -> press Run Without Debugging.
    image not found

Your Motorcortex program is now running on you controller!

Add Motorcortex Module to Motorcortex Project:

  1. Inside your Motorcortex Project, use keyboard shortcut ctrl+shift+p, search for Motorcortex Create Module.
  • Fill in the name of your file, example test:
    image not found
  • Fill in the name of your class, example testClass:
    image not found
  1. You have created your Motorcortex Module:
    image not found

Your Motorcortex Module is now added to your Motorcortex Project!