Creating and Editing Sketches

Like many integrated development environments, keeps information about your projects (called sketches to follow Arduino practice) in a project file. This file always should have the same name as the directory it resides in, and for compatibility with the Arduino IDE, will automatically create missing project files.

Creating a New Sketch

From the File menu, select NewSketch…. You will be prompted for a project name, and will then proceed to create

Adding a New File to a Sketch

From the File menu, select NewFile…. You will be prompted for a file name, and will create the file and add it to the frontmost open sketch. Preferably, the file should be placed in the sketch directory.

Currently, understands the following file extensions:

.h (.hpp, .hh)
C/C++ header file
.c
C source file
.cpp (.cxx, .c++, .cc)
C++ source file
.S
Assembly source file
.md
Markdown file

Be aware that the Arduino IDE will only understand a subset of these file types and extensions.

Adding an Existing File to a Sketch

Click the + button in the sketch window. You will be prompted for an existing file, which will be added to the sketch. Note that the file is NOT copied to the sketch directory, it should already reside there.

Deleting a File or Removing it From a Sketch

Select the file name and click the - button in the sketch window. You will be asked whether you want to move the file to the trash, or merely remove it from its sketch.

Using Libraries

The Arduino IDE ships with a selection of standard libraries, and many third party libraries exist on the web. In the Sketch menu, select the library you want to se from the Import Standard Library or Import Contributed Library submenus.