Using QtCreator for Arduino development


I’ve been using QtCreator for some time now, mostly for Qt projects, and I really like the environment. It’s fast and have plenty of features for c/c++ development such as code completion, symbol navigation, and git integration.

Today I decided to try if I could use QtCreator for Arduino development and it turned out that it wasn’t that difficult. The environment isn’t perfect but it works and it doesn’t take much effort to set up a project.

Disclaimer: I’m not doing Arduino development regularly, I just find it amusing to toggle bits on 8-bit hardware now and then. If you find anything in this post that seems totally wrong please let me know.


This tutorial assumes that you’re running Ubuntu. It shouldn’t be too difficult to adjust for other Linux distributions.

If you haven’t already installed the latest QtSDK (1.1.3), please download it from and do so.

Install arduino-core package from the Ubuntu repository

$> sudo apt-get install arduino-core

This should pull in required dependencies too, such as avr-gcc and avrdude.

Install gtkterm (optional, but recommended)

$> sudo apt-get install gtkterm

Creating a simple ‘Hello World’ project

You can create everything from within QtCreator but I find it easier to do the initial set up from command line.

$> cd <projects folder>
$> mkdir -p helloworld/src
$> cd helloworld/src

If you look at the top of the file /usr/share/arduino/ you’ll find instructions on how to create a suitable Makefile for your project.

Here’s one that I use, just put the content in helloworld/src/Makefile

ARDUINO_DIR  = /usr/share/arduino

TARGET       = main

MCU          = atmega328p
F_CPU        = 16000000

# Avrdude code

include /usr/share/arduino/

Finally create helloworld/src/app.cpp with the following content:

#include <WProgram.h>

void setup()

void loop()

Importing the Hello World project

Start QtCreator and go to ‘File/New File or Project’ (ctrl+n) and then choose ‘Other Project/Import Existing Project’.

Finish the wizard by specifying ‘HelloWorld’ as ‘Project name’ and ‘<projects folder>/helloworld’ as ‘Location’. You might wonder why I specified ‘helloworld’ as project location instead of ‘helloworld/src’. This is because I don’t want QtCreator’s project files to end up in the same folder as my source. Just click on ‘Next’ on the following questions to finish the wizard.

QtCreator creates three files:

  • HelloWorld.conf – Add defines
  • HelloWorld.files – List all files that are part of the project
  • HelloWorld.includes – List all include paths

Add ‘/usr/share/arduino/hardware/arduino/cores/arduino’ to ‘HelloWorld.includes’. This tells QtCreator where to look for Arduino specific header files.

Configuring ‘Clean/Build/Run’
Click ‘Projects’ (ctrl+5) on the bar to the left to activate the project settings page to change the build and run settings.

Clean and Build settings
Change ‘Build directory’ to ‘<projects folder>/helloworld/src’ and modify the settings to reflect the screen shot below.

Run settings
Choose ‘Add Deploy Step’ and use the screen shot below to specify the settings.

If you didn’t install gtkterm you can specify ‘echo’ or something in the ‘Run configuration’.

The Hello World app
Finally I’ll write the code and upload/run it on the Arduino.

Open ‘app.cpp’ and change the code to the following snippet:

#include <WProgram.h>

void setup()

void loop()
    Serial.println("Hello World");

Press ctrl+r and hopefully you’ll see ‘Hello World’ printed each second in the gtkterm console.

This Post Has 13 Comments

  1. Raja

    Nice, just started project using Arduino. This is useful. Post more about Arduino development.

  2. wally

    Do you think it’s possible to make a Arduino_project template (or project Wizard) for Qt-Creator ?

  3. Mario Boikov

    @wally I think I tried this but unfortunately I don’t remember the out come. Do take a look in the QtCreator template directory, you should find some example for simple C++ apps

  4. fahmi

    @Sinclair excuse me but the file is not found 404.

  5. Slava

    Please notice, for ubuntu 12.10 (I am not sure since which version) you also need to install package arduino-cli which provides file /usr/share/arduino/

  6. Alex

    Very very good, can I debug my programs?

  7. LeiHuang

    How to switch this QT to window system,could you pls provide me the tutorial? Thinks

  8. Mattis

    Thanks, works great (QtCreator 3.6.0)

  9. John

    I know this is very belated, but I could not find on either of my systems despite having arduino-core installed. I subsequently discovered that one also has to download the arduino-mk package:

    sudo apt-get install arduino-mk

    I am using QT4.5 and Arduino 1.8.9 and the IDE environment does differ somewhat, but the options are all present.
    I also had to modify my Makefile (as per instructions in the to be as follows:

    ARDUINO_DIR = /usr/share/arduino
    ARDMK_DIR = /usr/share/arduino
    # Set to YOUR avrtools path
    AVR_TOOLS_DIR = /usr/share/arduino/hardware/tools/avr

    TARGET = main
    BOARD_TAG = uno
    MONITOR_PORT = /dev/ttyACM0

    include /usr/share/arduino/

    Note that some boards requires /dev/ttyUSBx where x is the sequence number of the allocated USB port handle, .e.g. /dev/ttyUSB0.

    Hope this helps.

Leave a Reply