Entries:
Comments:
Discussions:

Loading user information from Channel 9

Something went wrong getting user information from Channel 9

Latest Achievement:

Loading user information from MSDN

Something went wrong getting user information from MSDN

Visual Studio Achievements

Latest Achievement:

Loading Visual Studio Achievements

Something went wrong getting the Visual Studio Achievements

There's an Arduino in your VS Code...

The final post for the VS Code Theme week comes from the man, the myth, the legend in his own mind :) Fabien Royer.

Given it's Hardware Friday and VS Code week, how can we mesh these two together?

Maybe a little Arduino development with VS Code? Yeah, that's the ticket!

fabienroyer/VisualStudioCodeArduino

arduino upload

Using Visual Studio Code as an Arduino IDE

The arduino IDE is great to get a project configured and started quickly, but its built-in code editor leaves a lot to be desired. Even though an external editor can be used instead, the experience could still be improved upon. With the release of Visual Studio Code for Linux, Windows and Mac OS, there's an opportunity to make coding for arduino enjoyable while preserving the ability to compile and upload sketches directly from the editor. Keep in mind that you'll still need to use the arduino environment at least once to manage a project's imported libraries, target boards settings, serial port settings, etc.

The following document describes how this can be accomplished in three easy steps.

1. Making the 'arduino' executable available

By default, the arduino environment on Linux is not visible outside of its installation directory and needs to be exposed as a command for Visual Studio Code to invoke it when compiling and uploading arduino sketches.

Skip this step if the arduino environment is already available from anywhere.

The following step creates a symbolic link to the arduino environment so that it can be accessed from anywhere. It is assumed that the arduino environment was installed in the user's /home directory, such as:

...

2. Copy the ino folder to your local Visual Studio Code extension folder

The ino folder in this repository provides Visual Studio Code with the arduino keyword definitions needed for syntax highlighting. It also specifies that .ino files should be handled as C/C++ files.

The repository contains the following files & folders:

...

3. Adding the Visual Studio Code Task Runners supporting arduino

From Visual Studio Code, do the following:

  1. Open the File menu and select Open Folder....
  2. Navigate to the folder containing your arduino projects.
  3. Bring up the command palette with Ctrl+Shift+P.
  4. Type task in the command window.
  5. Select Configure Task Runner. This will create a hidden folder named .vscode at the root of the arduino projects folder selected in step 2.

...

4. Usage

  1. Open a .ino project file.
  2. Bring up the command palette with Ctrl+Shift+P
  3. Type task in the command window.
  4. Select Run Task

...

terminal

Note

This procedure has been validated to work with the following configuration:

  • Ubuntu Linux 14.04 LTS
  • arduino 1.6.4
  • Visual Studio Code 0.9.x

 

[Click through for the repo]



Tags:

Follow the discussion

  • Oops, something didn't work.

    Getting subscription
    Subscribe to this conversation
    Unsubscribing
    Subscribing
  • Fabien RoyerFabienRoyer I move atoms with bits.

    Wow, Greg! I'm humbled.

    Cheers,

    -Fabien.

  • Greg Duncangduncan411 It's amazing what a professional photographer can do...

    @FabienRoyer: :)

  • wow, i'm impressed. I used to work with Arduino

    also, is this available in Windows? I'm currently having the latest version of Code

  • Wondering if there's a way to make this work for the Particle Photon, too. Awesome work, Fabien & Greg!

  • Fabien RoyerFabienRoyer I move atoms with bits.

    @nobodykid23: It works as-is under Windows as well.

  • Fabien RoyerFabienRoyer I move atoms with bits.

    @bradygaster: Thanks Brady :) The Particle Photon already has its own Atom-based IDE, similar to VS Code and features very similar commands.

    If you still wanted to use VS Code with the Particle boards, you could integrate them using the Particle's CLI interface

    I hope this helps.

    -Fabien.

  • BetteronlyBetteronly

    sorry,i can not use the vscode for arduino.
    i use the Win10, arduino 1.6.7,and vsCode as 0.10.1.

    i have read and done all the thinke of [https://github.com/fabienroyer/VisualStudioCodeArduino],
    but the arduino ino file code can not have syntax highlighting. :<
    why ?
    only Ctrl+Shift+B can start the arudino and comiple the code.
    can not use the Ctrl+Shift+T ,and Ctrl+Shift+C (maybe ther soft is used?) , why?

    help me..give me a mail



  • BetteronlyBetteronly

    sorry,i can not use the vscode for arduino.
    i am using the Win10, arduino 1.6.7,and vsCode as 0.10.1.

    i have read and done all the thing of [https://github.com/fabienroyer/VisualStudioCodeArduino],
    but the arduino ino file's code can not have syntax highlighting. :<
    why ?
    only Ctrl+Shift+B can start the arudino and comiple the code. :>>

    can not use the Ctrl+Shift+T ,and Ctrl+Shift+C (maybe ther soft is used?) , why?

    help me..give me a email. thank u.

  • BetteronlyBetteronly

    send me a email please..
    r o l i _ i ce @ 1 6 3. com

  • mp3tobimp3tobi

    Hey Betteronly,

    I have alreaday opened an issue on fabien's github repo.
    I think it's broken because with the new release of VSCode MS made a few changes of the grunt.js files location.
    But fabien answered me and he maybe will fix this, if he found a workaround.
    Hopefully MS don't change the files for the extensions again.

    VSCode is was a alpha and is beta now. So this could happen with all releases. :)

    Greetings, Tobi

  • BetteronlyBetteronly

    Hi,Tobi
    really,VSCode ver is not the ver of github。
    that is the problem for sure。

    3q very much。

Remove this comment

Remove this thread

Close

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.