Arduino: how I use it

I’m using Arduino for some time now to automate the heating system and the garden irrigation system.

Having a Linux box installed near my Arduino in my “workroom/lost time office”, I find much more convenient to interface to the Arduino from the Linux computer itself, than connecting a PC and using the usual IDE.
I find it much quicker to use the ino toolkit and utility to compile and download the code to Arduino. Simply create a directory for your project, with two directories in it (src for sketch.ino, which is your project, and lib where you put the extra libraries needed, if any) and a file named ino.ini containig comething like:

[build]
board-model = uno
[upload]
board-model = uno
serial-port = /dev/ttyACM0
[serial]
serial-port = /dev/ttyACM0

Now just throw ino build && ino upload. Someone will argue that that’s not so different from using the regular IDE, and that’s true, but if you have a Linux computer always connected to you Arduino (as I do), my way of dealing with it can be very, very handy.

I provide the extra packages needed for CentOS6 and CentOS7, other than the ones already supplied by CentOS itself and cpan, in my Lux repository.

Maybe someone could be wondering, why is your Arduino always connected to a Linux computer (which in the more outstanding case is my beloved Casa)?

The main reason is that I run programs on my Arduinos which regularly emit status messages on the serial (which is over USB, at least on the UNO model) and which accept commands on the serial itself. So having a Linux (or other OS) connected is just what is needed to interface with the Arduino running program. I use minicom, which is itself very very handy (I set the Arduino serial to 115200 baud):

minicom -o -b 115200 -D /dev/ttyACM0

Another handy side effect is that this way, the Arduino is powered from the computer USB.

But in my opinion, after some years of use, the main reason to interface Linux to Arduino is just the ino toolkit, which I was talking about at the beginning or this post.

 

Comments are closed.