2016-08-13 01:15:41 +02:00
|
|
|
# Visual Studio Code
|
|
|
|
|
2016-08-15 20:03:03 +02:00
|
|
|
Visual Studio Code is a Free Open Source code editor that you can use to edit your programs.
|
|
|
|
|
|
|
|
Working from Visual Studio code allows you to benefit from all the features
|
|
|
|
of a professional IDE while working with PXT: working with files,
|
|
|
|
git integration (or source control of your choice), hundreds of extensions.
|
2016-08-13 01:15:41 +02:00
|
|
|
|
|
|
|
![](https://code.visualstudio.com/home/home-screenshot-win-lg.png)
|
|
|
|
|
2016-08-15 20:03:03 +02:00
|
|
|
## Setup
|
2016-08-13 01:15:41 +02:00
|
|
|
|
|
|
|
Follow these instructions to setup your machine and edit your programs in Visual Studio Code.
|
|
|
|
|
|
|
|
* install [Visual Studio Code](https://code.visualstudio.com/)
|
|
|
|
* install [Node.JS](https://nodejs.org/en/)
|
|
|
|
* install the PXT Tools (on Mac or Linux, you might have to add ``sudo`` to the command).
|
|
|
|
```
|
|
|
|
pxt install -g pxt
|
|
|
|
```
|
|
|
|
* create a folder for your projects
|
|
|
|
```
|
|
|
|
mkdir microbit
|
|
|
|
```
|
|
|
|
* install the microbit target
|
|
|
|
```
|
|
|
|
pxt target microbit
|
|
|
|
```
|
|
|
|
|
|
|
|
That's it! You are ready to create new projects in code or open existing projects.
|
|
|
|
|
|
|
|
## Creating a new project
|
|
|
|
|
2016-08-15 20:03:03 +02:00
|
|
|
Open a shell to your ``microbit`` folder.
|
2016-08-13 01:15:41 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
# create a new subfolder for your project
|
|
|
|
mkdir myproject
|
2016-08-15 20:03:03 +02:00
|
|
|
cd myproject
|
2016-08-13 01:15:41 +02:00
|
|
|
# start the project set
|
|
|
|
pxt init
|
|
|
|
# open code
|
2016-08-15 20:03:03 +02:00
|
|
|
code .
|
2016-08-13 01:15:41 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
## Opening an existing project
|
|
|
|
|
2016-08-15 20:03:03 +02:00
|
|
|
You can extract a project from the embedded URL or .hex file. Open a shell to your projects folder
|
2016-08-13 01:15:41 +02:00
|
|
|
|
|
|
|
```
|
|
|
|
# extract the project from the URL
|
|
|
|
pxt extract EMBEDURL
|
|
|
|
```
|
|
|
|
where ``EMBEDURL`` is the published project URL.
|