Can Arduino IDE 2 work with folders in a project? For example, I am making a complex project and I save HTML (program scripts) in the html folder in the project. Unfortunately, IDE2 does not see this folder, so if I want to edit anything in the html folder, I have to use another editor.
Hi @vecerapl. Arduino IDE is a tool for developing Arduino sketches. So you can not use it to develop .html files, regardless of where these files are located. You should use another text editor or IDE for the development of .html files. VS Code is a popular choice.
However, when it comes to Arduino sketch code files, you can organize supplemental files into subfolders and edit those files in Arduino IDE.
There are two important things to know if you are going to do this:
.ino("Arduino language") files must be placed in the root of the sketch folder. You can only put non-.inofiles (e.g.,.h,.cpp) in subfolders.- You should put the files under a subfolder named
src.
You can organize the files in any arbitrary subfolder structure you like under that src subfolder. Arduino IDE compiles the contents of the src subfolder of the sketch recursively.
Arduino IDE automatically opens all the sketch code files present the root of the sketch when you open the sketch. It does not do this for the files in the subfolders. You can open an close those files on demand. I'll provide instructions you can follow to open a sketch code file from a subfolder of the sketch:
- Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
The "Preferences" dialog will open. - Check the box next to "Show files inside Sketches" in the "Preferences" dialog.
- Click the "OK" button.
The "Preferences" dialog will close. - Click the folder icon in the activity bar on the left side of the IDE window to open the "SKETCHBOOK" view.
- You will see a listing of the contents of your sketchbook folder. Click the ❯ icons to the left of the relevant entries to navigate to a code file from the current sketch that you want to open.
- Click on the file in the "SKETCHBOOK" view.
The file will open in a new editor tab. You can browse and edit the contents as needed. When you no longer need the tab, click the X icon on the tab to close it.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.