Mar 31, 2014 0 Comments in Learning, Mega 2560 by
Building Mega 2560 applications from the command line

Most of Arduino programmers well know the Arduino's GUI where they usually build their applications, but exists another way to build Arduino applications: directly from the command line with little help from other tools!

Let's see how!

warning Note: Programmers whose love managing their programs from the command line may enjoy this little tutorial :-]

First of all you need a Debian running on your Cosino based board then you need a Mega 2560 extension in order to test your Arduino applications.

Let's install needed programs first!

The arduino package holds all needed software to compile your programs (it holds the standard GUI too!), while scons and make are the command line tools whose will help us in doing the trick! Then git-core is need to clone our code, in fact now you must clone the Cosino's arduino-dev project from GitHUB:

here what you should get after cloning:

As you can see you have only two files: Makefile and blink.pde. The former is just the makefile of our project while the latter holds our Mega 2560 application (note that for all projects the PDE file has the same name of the holding directory. This is mandatory!). Well, let's see blink.pde:

As you can see there are no changes from the standard Arduino program, so you can write your application normally and then build it by using the command line! In fact you just need the command make to build your application:

That's all!

Now you can test your new Mega 2560 application by uploading file blink.hex into Mega 2560's CPU:

See documentation of the Mega 2560 extension for further info on this topic or consider to read these articles:

Facebooktwitterlinkedin
Tags:

Leave a Reply

Your email address will not be published. Required fields are marked *

+ 35 = 45