Arduino 1.0 and Atmel templates for Qt Creator 2.4.1 and Ubuntu 12.04

This article explain how to install Arduino Templates for Qt-Creator. A new version of this tutorial is available here. This tutorial is based on the following versions of software:

  • Ubuntu 12.04 LTS
  • Arduino 1.0
  • Qt Creator 2.4.1

Install packet

First, launch a terminal (ctrl-alt-t) and install Qt Creator:

sudo apt-get install qtcreator

Now install Arduino core:

sudo apt-get install arduino-core

Install Arduino Makefile:

sudo apt-get install arduino-mk

In the same way, install GTK terminal:

sudo apt-get install gtkterm

Modifying the makefile

Edit the file Arduino.mk:

sudo gedit /usr/share/arduino/Arduino.mk

Line 218 should be:

PARSE_BOARD = ard-parse-boards --boards_txt=$(BOARDS_TXT)

Replace this line by this new one:

PARSE_BOARD = $(ARDUINO_DIR)/ard-parse-boards --boards_txt=$(BOARDS_TXT)

Installing the templates

Download and extract this archive:

Copy folders in the Qt Creator Template directory:

cd path/to/downloaded/archive
sudo cp -R atmega/ /usr/share/qtcreator/templates/wizards/
sudo cp -R arduino/ /usr/share/qtcreator/templates/wizards/

Change read-acess rights for any user to the template folder:

sudo chmod -R 755 /usr/share/qtcreator/templates/wizards/arduino/

Start or restart Qt Creator for the new templates to be available:

QtTemplate

USB rights

Some programming devices like AVRISPmkII requires rights on USB devices. This can be done by adding a rules file (provided in the archive):

sudo cp 60-avrisp.rules /etc/udev/rules.d/

For changes to be applied, restart USB services:

sudo service udev restart

Note that if an AVRISPmkII device is connected, unplug and replug.

Add the current user to the dialout group:

sudo usermod -a -G dialout $(whoami)

Close your session to apply changes.

Qt Creator project configuration

Previous steps have to be done only once. But the following has to be done every time a new project is created. Create a new Arduino project through the Wizard. Once the project is created, go in the menu Tools>Option, change the terminal to xterm :

terminal

In the project Tab (left of the screen) select Build Settings. Add /src at the end of the build directory :

GenericManager

In build steps (if it not already done) select make all:

BuildStepsIn Clean steps, select  make clean:

CleanSteps

Go to the second tab : Run Settings, and set the following parameters:

RunSettings

Click run, the program should compile and upload in the Arduino.

3 thoughts on “Arduino 1.0 and Atmel templates for Qt Creator 2.4.1 and Ubuntu 12.04

  1. I appreciate your post on using QTCreator to program arduinos. Like many other people I ran into the problem of avrdude not communicating with the arduino when called directly. The solution was to set the baud to 57600. I guess that’s the expected default .

    Any ideas on how to add debugging? Or automatic port monitoring?

    1. Thank you for you feed back. To the best of my knowledge, Arduino does not support debugging via USB interface. You can debug with AVR tools but I think it will be hard to link with Qt-Creator. Automatic port monitoring is possible, after programming the Arduino, you can launch a serial terminal (for example a command line serial terminal), but I never find this solution very satisfying. We developed a small software named pandarduino for monitoring the port and the terminal. You can download the archive by clicking here. I’m sorry because explanations are in french !

Leave a Reply

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