Skip to content

Starting with Deviot

gepd edited this page Sep 21, 2017 · 4 revisions

Project Structure

The main difference you can find in PIO is it has is own project file/folder structure. In The Arduino IDE your project will look like this:

- mysketchname/mysketchname.ino

But in PlatformIO it's different:

[projectname]
├── lib
├── platformio.ini
└── src
    └── mysketchname.ino

If you came from the Arduino IDE, It could be hard to understand or annoying. By the default Deviot will maintain your project like always, but if you want try the PIO way or you alredy work with this project structure, you can go to Deviot Menu > Options > Use PlatformIO Structure, that way your projects will be treated at the PIO style.

If you already have a project with the PIO structure, you don't need to do anything. Deviot recognize it. If you have initilized environments, it will be listed in Deviot Menu > Select Environment

Deviot will automatize most steps to work with PIO, in all basic options you will not need to create any folder/file, including the platformio.ini.

New Sketch

The main diference with the New File option of Sublime Text is, with Deviot's option you will end with a Arduino or C++ template.

Create a new sketch from Deviot > New Sketch, type the name of your sketch and select the destination folder, your sketch will be stored in destination_folder/sketch_name/file(s)

There are two ways to create a new file:

  1. Enter myfile.ino, you will end with a file like this:
//myfile.ino

void setup() {
  // put your setup code here, to run once:
}

void loop() {
  // put your main code here, to run repeatedly:
}
  1. Enter myfile.cpp, you will end with this file:
//myfile.cpp

#include <avr/io.h>
#include <util/delay.h>

int main(void){
    // put your main code here:
}

If you enter a name whitout extension, Deviot will use the Arduino template by default, but you can change this behavior from Deviot Menu > Options > Use CPP on New File, this way you will end with the c++ template.

Select Board/Environment

PlatformIO support more than 400 boards, you can find the full list from Deviot Menu > Select Board. Each time you select a board you will be adding it to the environment list. In the environment list (Deviot Menu > Select Environment) you will find the list of environments pre-selected in the Select Board option and the environments already initialized in the platformio.ini project file.

You can remove an environment from Deviot Menu > Select Board, you will se a list all board availables, you can show only boards added, writing: *.

Selecting a board will remove the environment from platformio.ini and the compiled files.

PlatformIO is able to compile more than one environment at time, Deviot does not support this feature yet, but you can open an issue to request priority in the implementation of this.