Understanding the Arduino Sketchbook: Opening and Saving Arduino Sketches

preview_player
Показать описание
🤩 FREE Arduino Crash Course 👇👇

*Click Below to Read About This Topic on Our Website*

*Description:*

Understanding how the Arduino IDE sets up its file directory system can spare you some confusion when it comes to saving, organizing and opening your Arduino sketches (or sketches you have downloaded from the internet).

This week’s episode covers the following:

1. The Arduino IDE Sketchbook folder
2. How to change the default location where your Arduino sketches get saved
3. What happens when an Arduino file does not have an enclosing sketch folder of the same name
4. Where and how multiple tabs get saved in an Arduino sketch
5. Why the pancreas of a woodchuck is better suited than our own

*The Sketchbook Folder and Changing the Default Save Location*

The default location where Arduino sketches you write will be saved is called the Sketchbook.

The Sketchbook is simply a folder on your computer like any other. It acts as a handy repository for sketches and is also where add-on code libraries get saved.
...
If you want to change this default location, you click the Browse button next to the file directory path and choose a different place. Pretty simple.

*Sketch Folders*

If you go into your file directory system and open up the Sketchbook folder (again, named “Arduino” by default), you may see a bunch of folders that you didn’t make.

This is because every Arduino file must be inside a folder that has the same name as the file (there are some exceptions to this that we'll talk about in the moment).

When I write a new sketch and save it, the Arduino IDE automatically creates a new folder that has the exact same name as the sketch itself. The Arduino file (which has the extension .ino) is placed inside this enclosing folder, which is called a sketch folder.

...

If you open a .ino file that is not inside an enclosing sketch folder of the exact same name then you will get a pop-up from the Arduino IDE that says:

*Read More...*

*About Us:*
This Arduino tutorial was created by _pea. We are an education company who seek to help people learn about electronics and programming through the ubiquitous Arduino development board.

Have an awesome day!
Рекомендации по теме
Комментарии
Автор

Wow. Thank you. Simple and arbitrary. Throw out all you ever knew about folders, save as or organizing your own projects.

rhbruning
Автор

Thank you so much I have been going crazy trying to understand the file/Sketch saving. Now a lot clearer.

gmks
Автор

Yes! This very much clarified how the Arduino organizes files. Thank you!

allyourcode
Автор

very fast for a new old dude but very well done and explained where my files went.. thank you

bobharrison
Автор

Very useful info that I used today in 2021

craigmelvin
Автор

Thank you! I need to organize my sketches

flyingkitty
Автор

Thank you very much for that explanation!

rparkhouse
Автор

Thanks for the info. None of their file system operations work as expected.

charlesgoehring
Автор

TLDR: A sketchbook is a folder that contains "sketches". A sketch is also a folder, but it contains a .ino file, which contains the actual code. Very important note about naming: if the sketch folder is named MyWonderfulSketch, then the file in that folder must be named MyWonderfulSketch.ino. It isn't a sketch, unless you follow this naming rule!

allyourcode
Автор

Nice. How about changing the folder where the generated Hex file will be save? Because it is buried deep into the drive C, temporary folder. It's not so easy to locate the hex file.

freddiemortos
Автор

I have been looking all over for some answer to a question on this subject with no luck.. It pertains to Marlin software for 3d printers but seems like an arduino sketch question. Its seems like i can rename sketches ie. Marlin4 and the code can nolonger compile. Is that impossible? Should I add another folder of depth? Like \marlin4\marlin\marlin.ino?

kirkd
Автор

Is it possible to use another file location for my sketchbook files?
See: file - preferences - sketchbook location.
In my opinion I can choose there my own file location, other than the default c:/user/documents/Arduino.
But if I do, I get the message: "Compile failure for board Nano".
So what is the use to have the possiblity to change the Sketchbook location preference?

simcha
Автор

I'm having trouble putting this code unto my sketch Forward_Reverse_Serial_8ch it will not upload in my Arduino What is proper way to upload this code? thank you

jerryrichard
Автор

i don't understand what the purpose of the associated .ino in the same sketch folder is
i mean you can only upload one right? you can't upload both at the same time can you?
also i find it very annoying how every time you open something it opens another window
why doesn't it just open it in the window that is already open? why does it have to bring it up again , or why not just open it in a new tab like a browser?

andreamitchell
Автор

I've installed the IDE on a different drive, but when I download libraries from the library manager it creates another folder called libraries in the libraries folder.

this is how it is: D:\Program Files

icemanst
Автор

Arduino: 1.8.3 (Windows 10), Board: "Arduino/Genuino Micro"

fatal error: Keypad.h: No such file or directory

#include <Keypad.h>

^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Micro.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.









how do i fix this!

ajexjohnson
Автор

if you want to answer a question thats confusing the arduino community. here it is:- why does the ide flag an error when uploading a sketch into an arduino located insitue withing a pcb..

its ok to upload when not in a pcb but mounting into a pcb brings problems when subcequently trying to upload sketches.. ideas why and how to fix.

OnlyKnowsGod
Автор

Thank you!!! From an old fart who couldn't wrap his technically challenged brain around this even after watching many other videos

georgehoskins
Автор

I think he is using some kind a recording script in the video bro.

mortallife
Автор

"You forgot your Sketchbook" "Arduino cannot run because it could not create a folder to store your sketchbook" Oh-Oh, It looks like Arduino is also having problems with the Sketchbook...!

Popart-xhfd