Create a new project¶
To create a new project,
-
Copy the folder
~/.emCode/Templateto a new location. -
Rename the folder.
-
Open it with Visual Studio Code.
If you want to change the name of the main sketch Template, for example MyProject:
-
Rename the
Template.inofile with the new nameMyProject.ino; -
Edit the main
Makefileand change the value of thePROJECT_NAME_AS_IDENTIFIERvariable accordingly.
# C-compliant project name
PROJECT_NAME_AS_IDENTIFIER = MyProject
Warning
As for the standard Arduino IDE, avoid spaces and special characters in the path and name of the project.
If PROJECT_NAME_AS_IDENTIFIER is not specified, the compilation process will search for an.ino file in the project folder and check for its unicity.
Warning
Multi-tasking projects with multiple sketches require PROJECT_NAME_AS_IDENTIFIER set to the name of the main sketch.
Select the board¶
-
Select the main sketch on the left pane.
-
Select the board on the drop-down list on the bottom line.
The names of the boards always starts with the platform and then the MCU, and ends with an option.
As examples, Adafruit_Feather_M0_USB, Raspberry_Pi_Pico_W_RP2040_PicoProbe or Teensy_4.1.
The board can be changed afterwards with the same procedure.
Warning
Visual Studio Code shows the list of the boards only when a sketch .ino, a header .h or a code file .cpp is selected.
If your board is not listed, you can create a configuration file.
- Please refer to the section Add a board.
Customise the project¶
On the differnt files ReadMe.md, main sketch Template.ino, local library LocalLibrary.cpp and LocalLibrary.h:
- Adapt the fields
<#project#>and<#details#>,<#author#>,<#date#>and<#version#>,<#copyright#>and<#licence#>.
Alternatively, press Ctrl+Shift+H to use the find-and-replace function of Visual Studio Code.