2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								..  _ide_qtcreator: 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Qt Creator
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								==========
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								The `Qt Creator  <https://github.com/qtproject/qt-creator> `_  is an open source cross-platform integrated development environment. The editor includes such features as syntax highlighting for various languages, project manager, integrated version control systems, rapid code navigation tools and code autocompletion.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								This software can be used with:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-05-22 21:05:38 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								*  all available :ref: `platforms` 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								*  all available :ref: `frameworks` 
  
						 
					
						
							
								
									
										
										
										
											2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-05-17 16:27:09 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Refer to the `Qt-creator Manual  <http://doc.qt.io/qtcreator/> `_ 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								page for more detailed information.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								..  contents :: 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Integration
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								-----------
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-08-21 23:41:50 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								..  note :: 
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    Please verify that folder where is located `` platformio ``  program is added
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    to `PATH (wiki)  <https://en.wikipedia.org/wiki/PATH_(variable)> `_  environment
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    variable. See FAQ: :ref: `faq_troubleshooting_pionotfoundinpath` .
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-05-22 21:05:38 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Project Generator
 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								^^^^^^^^^^^^^^^^^
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-05-26 22:55:59 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Since PlatformIO 2.0 you can generate Qt Creator compatible project using
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								:option: `platformio init --ide`  command. Please choose board type using
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								:ref: `cmd_boards`  command and run:
  
						 
					
						
							
								
									
										
										
										
											2015-05-22 21:05:38 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								..  code-block ::  shell
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-05-26 22:55:59 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    platformio init --ide qtcreator --board %TYPE%
 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-22 21:05:38 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Then import this project via `` File > New File or Project > Import Project `` 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								and specify root directory where is located :ref: `projectconf` .
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-06-29 17:59:47 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								After import, we need to delete default build and clean steps and configure project with PlatformIO source code builder (click on Projects label on left menu or `` Ctrl+5 ``  shortcut):
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								..  image ::  ../_static/ide-platformio-qtcreator-3.png
  
						 
					
						
							
								
									
										
										
										
											2015-06-29 22:25:56 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    :target:  http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-3.png 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-06-29 17:59:47 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-05-22 21:05:38 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Manual Integration
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								^^^^^^^^^^^^^^^^^^
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Setup New Project
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								~~~~~~~~~~~~~~~~~
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								First of all, let's create new project from Qt Creator Start Page: `` New Project ``  or using `` Menu: File > New File or Project `` , then select project with `` Empty Qt Project ``  type (`` Other Project > Empty Qt Project `` ), fill `` Name `` , `` Create in `` .
 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								..  image ::  ../_static/ide-platformio-qtcreator-1.png
  
						 
					
						
							
								
									
										
										
										
											2015-06-29 22:25:56 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    :target:  http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-1.png 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								On the next steps select any available kit and click Finish button.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								..  image ::  ../_static/ide-platformio-qtcreator-2.png
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-06-29 17:59:47 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Secondly, we need to delete default build and clean steps and configure project with PlatformIO source code builder (click on Projects label on left menu or `` Ctrl+5 ``  shortcut):
 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								..  image ::  ../_static/ide-platformio-qtcreator-3.png
  
						 
					
						
							
								
									
										
										
										
											2015-06-29 22:25:56 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    :target:  http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-3.png 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-05-17 16:27:09 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Thirdly, change project file by adding path to directories with header files. Please edit project file to match the following contents:
 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								..  code-block ::  none
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    win32 {
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								        HOMEDIR += $$(USERPROFILE)
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    else {
 
							 
						 
					
						
							
								
									
										
										
										
											2015-06-29 17:59:47 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								        HOMEDIR += $$(HOME)
 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								    }
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-06-29 17:59:47 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    INCLUDEPATH += "$${HOMEDIR}/.platformio/packages/framework-arduinoavr/cores/arduino"
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    INCLUDEPATH += "$${HOMEDIR}/.platformio/packages/toolchain-atmelavr/avr/include"
 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								..  image ::  ../_static/ide-platformio-qtcreator-4.png
  
						 
					
						
							
								
									
										
										
										
											2015-06-29 22:25:56 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    :target:  http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-4.png 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								First program in Qt Creator
 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-22 21:05:38 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Simple "Blink" project will consist from two files:
 
							 
						 
					
						
							
								
									
										
										
										
											2015-05-22 21:05:38 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								1.  In the console, navigate to the root of your project folder and initialize platformio project with `` platformio init `` 
  
						 
					
						
							
								
									
										
										
										
											2015-05-17 16:27:09 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								2.  The main "C" source file named `` main.c ``  must be located in the `` src ``  directory.
  
						 
					
						
							
								
									
										
										
										
											2015-05-22 21:05:38 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Let's create new text file named `` main.c ``  using `` Menu: New File or Project > General > Text File `` :
 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								..  image ::  ../_static/ide-platformio-qtcreator-5.png
  
						 
					
						
							
								
									
										
										
										
											2015-06-29 22:25:56 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    :target:  http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-5.png 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Copy the source code which is described below to file `` main.c `` .
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								..  code-block ::  c
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    #include "Arduino.h"
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    #define WLED    13  // Most Arduino boards already have an LED attached to pin 13 on the board itself
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    void setup()
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    {
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      pinMode(WLED, OUTPUT);  // set pin as output
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    void loop()
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    {
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      digitalWrite(WLED, HIGH);  // set the LED on
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      delay(1000);               // wait for a second
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      digitalWrite(WLED, LOW);   // set the LED off
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								      delay(1000);               // wait for a second
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    }
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-05-17 16:27:09 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								3.  Locate the project configuration file named `` platformio.ini ``  at the root of the project directory and open it.
  
						 
					
						
							
								
									
										
										
										
											2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								..  image ::  ../_static/ide-platformio-qtcreator-6.png
  
						 
					
						
							
								
									
										
										
										
											2015-06-29 22:25:56 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    :target:  http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-6.png 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-05-17 16:27:09 -07:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Edit the content to match the code described below.
 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								..  code-block ::  none
  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    #
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # Project Configuration File
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    #
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # A detailed documentation with the EXAMPLES is located here:
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # http://docs.platformio.org/en/latest/projectconf.html
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    #
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # A sign `#` 
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    # Comment lines are ignored.
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    [env:arduino_uno]
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    platform = atmelavr
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    framework = arduino
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								    board = uno
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								Conclusion
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								----------
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-05-22 21:05:38 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								Taking everything into account, we can build project with shortcut `` Ctrl+Shift+B ``  or using `` Menu: Build > Build All `` :
 
							 
						 
					
						
							
								
									
										
										
										
											2015-04-15 16:42:12 +03:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								..  image ::  ../_static/ide-platformio-qtcreator-7.png
  
						 
					
						
							
								
									
										
										
										
											2015-06-29 22:25:56 +03:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								    :target:  http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-7.png 
 
							 
						 
					
						
							
								
									
										
										
										
											2015-06-29 17:59:47 +03:00