Visual Studio Code

  • Windows Compatible
  • Mac Compatible
  • Linux Compatible
  • Not Chrome Compatible
  • Not iOS Compatible
  • Not Android Compatible

Product Details

Visual Studio Code (not to be confused with Visual Studio) is a free, open source editor ideal for experienced users who just want a 'text editor' to use with the command line PICAXE compilers. It works well on Mac and Linux as well as on Windows (although on Windows we recommend PE6 instead).

Note that VS Code is a more 'technical', but very powerful, editor for more experienced users. It includes full PICAXE compiler integration and includes syntax highlighting for PICAXE BASIC files. It also allows use of GIT source control.


Note that the PICAXE extension is currently in beta testing and so not yet formally published in the VS Code extensions store, so must be manually installed at present. It is the intention to submit it to the official extension store in the future to make installation simpler.

 


Pre-Installation

After downloading the prerequisites given on the Downloads tab above you should have three files -

On Linux

On Mac

On Windows

It will be helpful to unzip the picaxe-vscode.zip file to obtain its contents as three separate folders -

  • extensions
  • keybindings
  • tasks

Those files and directories can then be used for Visual Code Studio installation.


Installation

Installing Visual Studio Code

On Linux

Locate the code*.tar.gz file and extract to a temprorary folder such as /tmp/vscode -

  1. Open the File Manager
  2. Double-click on the code*.tar.gz file
  3. In Archive Manager, click Extract
  4. Double-click 'file system'
  5. Double-click 'tmp'
  6. Click on Create Folder, enter 'code' and press enter
  7. Click on Extract
  8. When extracted, click on Close
  9. Close the Archive Manager

On Mac

To be completed

On Windows

  1. Open the File Explorer
  2. Double-click on the VSCodeSetup*.exe file
  3. Proceed through the various options
  4. It is recommended to select the "Create Desktop Icon" option
  5. When extracted, untick the "Launch Visual Studio Code" checkbox, and click on Close

 

Installing PICAXE Compilers

On Linux

Locate the picaxe.tar.gz file and extract to a /tmp/picaxe directory -

  1. Open the File Manager
  2. Double-click on the picaxe*.tar.gz file
  3. In Archive Manager, click Extract
  4. Double-click 'file system'
  5. Double-click 'tmp'
  6. Click on Create Folder, enter 'picaxe' and press enter
  7. Click on Create Folder, enter 'compilers' and press enter
  8. Click on Extract
  9. When extracted, click on Close
  10. Close the Archive Manager

Note that the PICAXE compilers are 32-bit executables. If using a 64-bit Linux installation it is necessary to install 32-bit library support to allow the compilers to be executed.

The easiest way to do this is to install the gcc-multilib package from a Linux Terminal using -

    sudo apt-get install gcc-multilib

Also ensure that all the compiler files have executable file permission set.

On Mac

To be completed

On Windows

  1. Open the File Explorer
  2. Right click on the picaxe.zip file, and select "Extract All"
  3. Select "C:\Program Files (x86)\Microsoft VS Code\resources\app\extensions\picaxe\compilers"
  4. Click on "Extract"
  5. When extracted, Close File Explorer

 

Installing Visual Studio Code PICAXE Extensions

Locate the extensions directory extracted from the picaxe-vscode.zip file and copy that to the Visual Studio Code directory -

On Linux

  1. Open the File Manager
  2. Single-click on the 'extension' directory
  3. Right-click and select Copy
  4. Double-click on File Sytem
  5. Double-Click on 'tmp'
  6. Double-Click on 'code'
  7. Double-Click on 'VSCode-linux-ia32'
  8. Double-Click on 'resources'
  9. Double-Click on 'app'
  10. Right-Click and select Paste
  11. At the File Conflict pop-up click Merge

On Mac

To be completed

On Windows

  1. Open the File Explorer
  2. Locate the extensions directory extracted from picaxe-vscode.zip
  3. Copy the extension directory to "C:\Program Files (x86)\Microsoft VS Code\resources\app"
  4. Click on Yes to the warning that an extension folder already exists
  5. When completed, close File Explorer

 

Completing Visual Studio Code Setup

On Linux

To launch the Visual Studio Code application -

  1. Open the File Manager
  2. Double-click on File Sytem
  3. Double-Click on 'tmp'
  4. Double-Click on 'code'
  5. Double-Click on 'VSCode-linux-ia32'
  6. Double-Click on 'resources'
  7. Double-Click on 'code'

On Mac

To be completed

On Windows

The Visual Studio Code application can be launched from the Desktop Icon, or through the "programs" section of the Start Menu.

 

Note that all further installation will be done inside Visual Code Studio itself. 

On all platforms:

Once the Visual Studio Code application opens you should be presented with a Welcome screen, and a browser window will launch showing an introductory page for Visual Studio Code. The browser may be closed if desired.

Close the Welcome screen by clicking on the "x" next to "Welcome"

Create a Source Code Directory

Click on the Visual Studio Code Explorer icon.

  1. Double-click on File Sytem
  2. Select the root project folder you want to use for your PICAXE projects. 
  3. Click on Create Folder, enter a folder name such as 'source' and press enter
  4. Click OK

Click on 'New File' in the FOLDER menu, and enter 'test.bas' and press return.

Enter a line of PICAXE basic, for example -

    Symbol myPin = C.1

Close and save the edit window by clicking on the cirle next to "test.bas"

Setup Keybindings

Select the File, Open File menu option, and select the keybindings/keybindings.json file downloaded and unzipped earlier.

Select the File, Preferences, Keyboard Shortcuts menu option.

This will bring up two additional "keybindings.json" edit windows. The middle one is the global bindings, the one on the right are personal bindings.

Copy the keybindings.json contents from the left window into the personal bindings to the right hand edit window.

Close and save the right hand personal bindings window, close the other two windows.

Setup Tasks

Select the File, Open File menu option, and select the tasks/.vscode/tasks.json file from the earlier downloaded files. You may have to right click and select "Show Hidden Files" to be able to see the .vscode folder.

Locate the "command" which will show as "/path/to/...".

For Linux, edit that to be

"/tmp/picaxe/compilers/picaxe08m2".

For Mac, edit that to be

To be completed

For Windows, edit that to be the path to the compilers e.g.

"C:\\Program Files (x86)\\Microsoft VS Code\\resources\\app\\extensions\\picaxe\\compilers\\picaxe08m2.exe"

Note that all occurances of the usual "\" path separator for Windows has to be doubled up to "\\".

Select the File, Save As menu option.

  1. Double-click on File Sytem
  2. Double-Click on the 'source' folder
  3. Click on Create Folder, enter '.vscode' and press enter
  4. Click Save.

Close the 'tasks.json' edit wndow.

Testing Compilation

Select the "test.bas" file from the SOURCE section of Visual Studio Code. Once in the edit window press the F4 function key.

This should syntax check the program and show details at the bottom of the Visual Studio Code window.

Disconnect any AXE027 or other download cable and press the F5 function key.

This will attempt to download the PICAXE program with the results shown at the bottom of the Visual Studio Code Window. At this point the download will not succeed - most likely failing with a "Can't open port" error; this is expected and can be fixed by entering the correct COM path in the "tasks.json" file.

Press the F6 function key and this will show what tasks are available.

Updating programming settings

The programming settings are all held in the "tasks.json" file we saved earlier in the .vscode subdirectory of the source directory holding "test.bas".

The "tasks.json" file can be opened and the "Linux" section edited and saved to change the compiler and download COM port to be used.


Notes

Visual Studio Code

Visual Studio Code is self-updating and will prompt to install or delay updates.

When Visual Stdio Code updates it will refresh its extensions directory which will remove PICAXE extensions which will be most noticable in losing PICAXE colour highlighting.

If the PICAXE extensions are lost, they should be reinstalled following the procedure earlier.

Programming Settings

Programming settings are configured on a per source code directory basis; a .vscode subdirectory and "tasks.json" file should be created for each directory which holds PICAXE source code.

Some users may find it desirable to create a separate source code directory for each variant of PICAXE chip they use. This will ensure the "tasks.json" file relates to the type of PICAXE the source code is for.

Visual Studio Code Requirements

VS Code has been tested on the following platforms:

Linux (Debian): Ubuntu Desktop 14.04, Debian 7

Linux (Red Hat): Red Hat Enterprise Linux 7, CentOS 7, Fedora 23

OS X Yosemite

Windows 7 (with .NET Framework 4.5.2), 8.0, 8.1 and 10 (32-bit and 64-bit)

Downloads

Visual Studio Code download (offsite) Visual Studio Code
PICAXE extension for VS Code PICAXE Extension
PICAXE Compilers PICAXE Compilers

Revision History

0.01 First release

Related Products