Skip to content

Move sketches to appropriately named folders #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 28, 2018
Merged

Move sketches to appropriately named folders #1

merged 1 commit into from
Nov 28, 2018

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented Nov 28, 2018

The Arduino IDE requires that a sketch be located in a folder of the same name.

When opening a file that does not meet this sketch/folder name matching requirement the Arduino IDE presents a dialog:

The file "SKETCHNAME.ino" needs to be inside a sketch folder named "SKETCHNAME".
Create this folder, move the file, and continue?

In the case of a sketch with a single source file, if you click "OK", the Arduino IDE will take the correct action, but this is an unnecessary extra step, which will cause confusion for beginners.

The problem is more serious with a sketch that has multiple source files, such as Episode 6 - LED matrix. After clicking "OK" the Arduino IDE currently moves only the file SKETCHNAME.ino to the new folder, leaving behind the other source files. This causes compilation of the sketch to fail:

realMatrix:17:21: error: ledData.h: No such file or directory

Sketch folder name mismatch causes import of the sketches to the Arduino Web Editor via the downloaded .zip file of this repository to fail:

This .Zip file does not contain a sketch, check the file and try again.

The sketches with single source file may be imported individually after unzipping the file, but this will leave behind the Fritzing and readme files. In the case of a multiple source file sketch such as Episode 6 - LED matrix, ledData.h is not imported along with realMatrix.ino, resulting in the same error as in the Arduino IDE.

The Arduino IDE requires that a sketch be located in a folder of the same name.

When opening a file that does not meet this sketch/folder name matching requirement the Arduino IDE presents a dialog:

The file "SKETCHNAME.ino" needs to be inside a sketch folder named "SKETCHNAME".
Create this folder, move the file, and continue?

In the case of a sketch with a single source file, if you click "OK", the Arduino IDE will take the correct action, but this is an unnecessary extra step, which will cause confusion for beginners.

The problem is more serious with a sketch that has multiple source files, such as Episode 6 - LED matrix. After clicking "OK" the Arduino IDE currently moves only the file SKETCHNAME.ino to the new folder, leaving behind the other source files. This causes compilation of the sketch to fail:

realMatrix:17:21: error: ledData.h: No such file or directory

Sketch folder name mismatch causes import of the sketches to the Arduino Web Editor via the downloaded .zip file of this repository fails:

This .Zip file does not contain a sketch, check the file and try again.

The sketches with single source file may be imported individually after unzipping the file, but this will leave behind the Fritzing and readme files. In the case of a multiple source file sketch such as Episode 6 - LED matrix, ledData.h is not imported along with realMatrix.ino, resulting in the same error as in the Arduino IDE.
@dcuartielles dcuartielles merged commit e2f4301 into arduino:master Nov 28, 2018
@dcuartielles
Copy link
Member

Thanks for the contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants