1
votes

There are two official ways of compiling Arduino sketches; The Arduino IDE that can either be installed by ppa or by downloading the source or the "ino" compiler that also could be downloaded by source.

I don't like both of them. The Arduino IDE needs to be run as root to work fully correctly and has a way too simple editor. The Ino Compiler Doesn't work with my Sketches (especially those with ethernet support, see Arduino CLI Compiler “ino” and some basic sketches lead to compile errors) and I also don't really know how it behaves when I feed it with some C++ or even C++11

What I really like to know: Is there a way to compile the arduino sketches the "Unix"-Way either with gcc or with clang. What libraries do I need to include, are there any example makefiles? How do I upload them to my arduino?

btw. Using Ubuntu 13.10 and soon 14.04 on 64bits. Having Arduino Mega 2560, Arduino Uno and Arduino Mini/Nano compatible board as well as an Ethernet Shield.

1

1 Answers

1
votes

The Arduino IDE needs to be run as root to work fully correctly and has a way too simple editor.

that is a configuration fault of the deb package. Arduino ide runs fine if user has right priviledges on the serial. Especially the newest 1.5.6-R2 witch is compatible with new linux /run rules (old RXTX has been replaced)

The Ino Compiler Doesn't work with my Sketches

you are not using the packaged compiler, but your distribution one's witch is a lot newer and break code. Also we don't know witch patch are applied on that compiler, so the results will be unreitable. Try to download the arduino IDE from the official site, and just unzip it and run. It will compile fine, as it will use its own (old) compiler. On github you'll see they are working on resolving these bug, you can download the specific branch.

Is there a way to compile the arduino sketches the "Unix"-Way

yes, but not easily. you have to convert the .ino into a .cpp and add a main() method. there are some makefile that do that, but they will be break-prone, you should use CLI now that it has been provided. If you still want to use an external makefile, see https://github.com/sudar/Arduino-Makefile