Pages

Labels

Wednesday 26 February 2014

Coding the Arduino in C++ - Choosing a development environment

So now that we have decided what language to write the code in, we need to decide what development environment we want to use, and with the passion that surrounds Arduino, it is not surprising to discover that we are going to be spoilt for choice.

It is however important to remember that we have a number of requirements that we should keep in mind when assessing each environment, these are:
  • Coding in C++
  • Ability to use testing frameworks, including:
    • Google Test (GTest)
    • Google Mock (GMock)
  • 'Projects' that can build on Continuous Integration (CI) build servers, in particular: 
    • Teamcity

Arduino Studio

The first option you are likely to come across, is Arduino's own development environment, Arduino Studio, which truly is a multi-platform set of tools. Even if you end up not using this application, it is strongly advisable to install it, ensure that items like the Windows USB device driver are installed and working, this is well put together and will ensure some of the easy to forget, and hard to retrospectively install are done for you. I would also encourage you to spend a little time going through the process of writing a few of the introduction sketches, as this will make the jump into Arduino development that a little smoother.

The biggest main reason I have chosen not to use Arduino Studio is that as I progress I want to be developing the coding side of the prototyping I plan to do using a truly Test Driven Development (TDD) approach, and run the builds themselves on CI build servers. Although that is not impossible, the TDD framework, and CI environment discouraged me from going down this route.

Atmel Studio

Another option out there, and the one built by the manufacturer of the microcontroller chips, is Atmel Studio, a fully featured Integrated Development Environment (IDE), which is in part because it has been built on top of an existing industry standard IDE, Microsoft's Visual Studio. The fear here would normally be that this would be an expensive option, but it isn't, both Microsoft and Atmel provide their portions of this product free of charge. The biggest problem I have with this is that in order to run the application you must be running Windows, and this does not easily fit in with the mixture of development machines that we use (a combination of Windows, and Mac).

Eclipse

So what else is there? In every branch of software development a product comes up time and time again, Eclipse, and I know that there are many out there that won't have a bad word said about it. However the consensus in our development team is very negative towards this product, so selling it as a development tool for Arduino could adversely effect on Arduino development.

Back to basics

Everything investigated above, and many other options not documented in this post, have all had issues that makes them unsuitable for our requirements, so in the end we have chosen the most universal of the coding environments, the text editor.

More precisely we have chosen a process for developing, rather than an environment, in particular using CMake to define a build file, and Rake as the script that will run it.

Now I know that there will be many out there that are shuddering at this idea, having spent many years working in the comfortable surroundings of Visual Studio, I know how easy it is to become dependent on an IDE that does much for you, and highlights clearly anything it has a problem with, and with third party plugins, like JetBrains Resharper, the process of coding becomes simpler still.

But in this day and age, understanding an assortment of languages, and environments is what all developers should be striving for, and a scripting language like Rake can be used on so many platforms that not learning about it would seem foolish.

What's Next

In the next couple of post I will go through setting up both Windows and Mac OS X, to build projects using this approach, and then I'll detail how to setup Teamcity to enable automated builds and tests to take place.

Once we have done this, I will start a series of posts in which I will take you through the process of developing Arduino projects in a truly TDD approach. 

2 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. I have used Eclipse for C++ and it was pretty good. C++ in Urdu

    ReplyDelete

 
 
Blogger Templates ReadABlog.com