Go Down

Topic: I dont't want Arduino to open with the last sketch (Read 1 time) previous topic - next topic

stan2013

The Arduino IDE always opens with the last sketch. Is there a way to let Arduino always open only with an empty sketch?

pert

Two options:

Edit/create the shortcut to point to an empty sketch. For example:
Code: [Select]
"C:\Program Files (x86)\arduino-1.8.5\arduino.exe" "C:\Program Files (x86)\arduino-1.8.5\examples\01.Basics\BareMinimum\BareMinimum.ino"

Make a script or batch file that sets a preference to cause the Arduino IDE to start from a new sketch:
Code: [Select]
"C:\Program Files (x86)\arduino-1.8.5\arduino_debug.exe" --pref last.sketch.count=0 --save-prefs
"C:\Program Files (x86)\arduino-1.8.5\arduino.exe"

This requires a relatively recent version of the Arduino IDE. The downside to this is it makes the load time much slower because it essentially has to start the Arduino IDE twice. Once to set the preference, and once to actually start the IDE. Unfortunately you can't set the preference and start the IDE in the same command.

If you're using a different operating system other than Windows you'll need to make some minor adjustments to the above commands. Most significant is you only need to use arduino_debug.exe for CLI on Windows. With any other OS you can just use the regular arduino executable for both commands.

JanRubanowicz

Hi, the solution I found, was in the Arduino IDE, go to,

1) File then Preferences.

2) At the bottom of the file preference page, there is a file location for (preferences.txt).

3) Click on that, and you will be taken to the ArduinoData directory.

4) In that directory, you will find a text file called preferences.txt 

5) Click on that and up comes the text file.
 

WARNING PLEASE CLOSE THE ARDUINO IDE BEFORE EDITING THIS TEXT FILE.


6) look for the entry,  last.sketch.count=0

7) change this entry to,    last.sketch.count=1



save and exit

This will call up a new blank sketch, instead of the last sketch, when you next restart IDE.


I hope this will be useful, please reply if it was.

italex33

Hi, the solution I found, was in the Arduino IDE, go to,

1) File then Preferences.

2) At the bottom of the file preference page, there is a file location for (preferences.txt).

3) Click on that, and you will be taken to the ArduinoData directory.

4) In that directory, you will find a text file called preferences.txt 

5) Click on that and up comes the text file.
 

WARNING PLEASE CLOSE THE ARDUINO IDE BEFORE EDITING THIS TEXT FILE.


6) look for the entry,  last.sketch.count=0

7) change this entry to,    last.sketch.count=1



save and exit

This will call up a new blank sketch, instead of the last sketch, when you next restart IDE.


I hope this will be useful, please reply if it was.
I changed to 0, not 1, it works!

brandonb541

You also have to change to Read-Only in the preferences otherwise it will just overwrite next time.

Go Up