How to use multiple tabs



The Arduino IDE supports editing multiple files in the same window. It uses a standard tab structure seen in many other applications, which allows uses to select which document to edit. As the sketch must have all its files in the same folder, you cannot edit a document located elsewhere. You can add files to the sketch folder yourself, or add them using the IDE.

Inside the IDE, the main menu bar has an option Sketch which contains Add file; this allows you to select a file to add to your project. You can refer to the image below for the menu option.

 Shows the add file menu in the Arduino IDE

On adding an external file, it is copied to the sketch folder and the copy is loaded into a new IDE tab. The Arduino IDE will only open certain source files it knows about, they are listed below. For an explanation of each accepted file type, visit this FAQ: What are the different file extensions for?

  • .ino
  • .pde
  • .h
  • .cpp
  • .c

Any other type of file added to a sketch will be copied into a sub directory labelled data. These modifications do not affect any files you have placed in the sketch folder manually.

For information on separating your sketch into multiple files, see this FAQ: Breaking a sketch into multiple files.

Tags: tabs
Last update:
2014-05-13 01:47
Author:
Christopher Andrews
Revision:
1.0
Average rating: 5 (1 Vote)

You can comment this FAQ

Chuck Norris has counted to infinity. Twice.