ElectronicZoologyfield notes from the garage
← Back
Arduino basics

The Sketch Folder

Where your .ino file lives - and where Arduino looks for header files

Every Arduino sketch lives in its own folder. The folder name must match the .ino filename - Arduino IDE requires this. So a sketch called MySketch.ino must live inside a folder called MySketch/.

Why it matters for header files

When your sketch contains #include "myclip.h", Arduino IDE looks for that file in the sketch folder first - the same folder as your .ino file. If it is not there, the build fails. No extra configuration needed - just drop the .h file in the right place.

How to find your sketch folder

With your sketch open in Arduino IDE, go to:

Sketch > Show Sketch Folder

This opens the folder in your file manager. Copy your .h file in there, then return to Arduino IDE and compile.

Where sketches are saved by default

Arduino IDE saves sketches in a folder called Arduino in your home directory:

~/Arduino/MySketch/MySketch.ino

Your header file goes right next to it:

~/Arduino/MySketch/myclip.h

Key details

  • Every Arduino sketch lives in its own folder
  • The folder name must match the .ino filename
  • Any .h file in that folder is automatically available to #include
  • Use Sketch > Show Sketch Folder to open it in your file manager