📜 ⬆️ ⬇️

Ino - working with Arduino from the command line

image Hello!

Those who worked with Arduino know that there is a special Arduino IDE for programming it. In fact, it is a notebook with two buttons: “flash” and “listen through serial”. Notepad is suitable for writing small program-experiments, but vybeshivaet when writing something more.

Many are used to working in their favorite Visual Studio, Eclipse, KDevelop, etc. I myself am a staunch fan of Vim, the terminal window and the Alt + Tab buttons. I have long wanted to build projects for Arduino was as simple as in the official IDE, but their terrible editor never came across. Moreover, the language "Arduino" despite the positioning as a separate, simple programming language - it is nothing like C ++. And everything is going to end up with the tools avr-gcc.
')
To solve the problem Amperkoy was created by Ino .

Prehistory


I have never understood why Arduino Software was made as a monolithic solution, and was not split into 2 layers: the command line and UI. That is what limited the possibilities of working in your favorite editors. It was not clear to me alone, so the people now and then shared all sorts of Makefiles, CMake scripts, wscripts, SConstructs. However, all this was not universal enough, the copy-paste between the projects was dragged along and poorly expanded.

I tried to arrange a convenient assembly in the form of extensions for SCons and Waf. Both attempts were successful to some extent, but in the end the project structure and pipeline assemblies turned out to be quite complicated so that it would be possible for someone to explain in half a minute how to use it correctly.

In the end, I decided to do something with an extremely simple interface. As simple as git, mercurial, svn:

- ---

Highlighting the basic steps that are needed when working with Arduino, it turned out the following:

ino init #
ino build #
ino upload # arduino
ino serial # serial

What happened


It turned out what I wanted. In order not to reinvent the wheel from scratch, make is used to build off-screen. Implemented automatic tracking of used libraries, as in the original IDE; source codes are also searched on the machine, without the help of any xfiles in each directory.

In general, compatibility has been kept to the maximum to make the Arduino IDE and Ino interchangeable. I hope the tool will be useful to others. What does the public think?

Source: https://habr.com/ru/post/131653/


All Articles