I was just in the middle of updating my preference file loader a little in the thought I should share it.
It was basically a small exe program that makes it easier to preload a different preference file before you load the project.
Handy if you work on different devices and are fed up having to tinker with the settings every time you change the platform.
Two Simple functions.
1: Save current preference file as a related project file.
2: Double clicking on the list will replace the preference file with a version related to the project and then start the IDE loading the project.
I was going to look thru the IDE source and try to add this functionality natively but I just do not have the focus right now and this old VB project is just easier for me to tinker with.
I've been using it for years and it does just what I need it to.
If you can think of any simple features to include, just shout.
I'll tidy it up and post up a version later for any that wish to try it.
If your project is what I think it is then you might consider looking at the way the preferences are saved using the CREATE online editor which already does a similar thing.
Tying into that would give you something that is compliant with an existing standard.
When you download a sketch from there it saves a preferences file a JSON type CSV format / file.
Example below is for a UNO
Hey Bob,
Yes someone had mentioned that the online stuff remembers settings better.
Surprised to see it had not crept thru to the standard IDE.
But anyway, what I created was pretty dumb.
It simply copies the complete preference file as is.
So no real need to know the format or anything really.
I do read some info out of the file like "sketch.folder" and board type but at this point there has been no need to edit or further parse. People can obviously edit the pref files manually
I can also tag the top line of my ino files with a board define and that too will help select the correct pref file. Like //#define board nano
I guess it will only be of interest to people that switch between Boards frequently.
But it may inspire someone to bolt the idea into the IDE itself.
cos it was only used inhouse there was no reason to make it consumer proof.!
Still tweaking it a bit,
With luck it will find the preference file and read the sketch folder from that.
No other setup required
I presume that most peoples preference file is in
"%userprofile%\AppData\Local\Arduino15\preferences.txt"
I realise that I did not give many instruction and there is little help.!!
I guess that if the program has run and it found your ino sketches then all is good.
The saved Preferences files are kept in the prefs folder.
Click on a project and then right click and click "Save Current".
That will create your first related preference file using the current IDE settings.
You can also use that header I mentioned like
//#define board Nano
If that is seen in the first line then it will assign the "/prefs/preferences_Nano.txt"
OR
//#define board ESP32
If that is seen in the first line then it will assign the "/prefs/preferences_Esp32.txt"
Just create or copy those files as you need them.
Best method to create the files is simply configure the IDE how you want, Exit the IDE, use the "save current" menu and then go and rename the filename to what you want.
Hope that makes sense.!!
This was pulled from a larger program that also offered a serial monitor, simple http server and a project versioning with OTA / spiffs updater tool. The program itself was also auto updating.
This Arduino_prefs.exe is just a small part of that tool collection.
Currently it is not auto-updating so any changes will need the exe replacing manually.
If it proves popular I shall continue to post updates.
If you use the IDE to develop with multiple platforms or devices then changing from one to the other is annoying cos you have to run thru the various settings again.
Setting up comport, speeds, fuses, options and the like.
This just took away some of that thought process and work load.!
Hiddenvision:
If you use the IDE to develop with multiple platforms or devices then changing from one to the other is annoying cos you have to run thru the various settings again.
Setting up comport, speeds, fuses, options and the like.
I understand and agree.
I have written a short Python program to compile and upload my programs from the Geany editor using the command line IDE and I have a few lines like this at the top of each of .ino files
Hey Bob,
Darn, that's a shame.
Still I bet they have other more important things to get their head around.
I shall continue to tweak this prog a little,
perhaps I may start to add in some extra features depending on the feedback.
If you have used or are using this, feel free to drop a comment.
Ok, Added in the auto update stuff.
With luck there will be no need to post another update here.
You will need to (if desired) add the update location to your ini file
Either copy and paste from the included file or just replace the ini file in total.
Oh I forgot to add the VB6 OCX files needed.
See Later Post for those.
Your system may already have one or both of them, no need to replace.
did a few updates. (you click on the version number to autoupdate).
It now saves the menu and search options rather than always defaulting to original.
It also saves a projects.txt file to speed up loading rather than scanning the folders each startup.
I also added a Merge function for merging or replacing static preferences into the mix but I am still working on that bit, I don't need it but I can see it being useful one day.
Um not much else apart from fix all the things I found that nobody has commented about yet.
If you have questions or would like it to do something I had not considered then just shout.
If the program if failing to run due to missing ocx see later post for VB_OCX.zip
Oops,
I forgot to make available the two required VB6 OCX files.
That could bring a halt to the party.
Ocx files are best placed/unziped into the "windows/System32" folder.
However you may ALSO need to put them in windows/SysWOW64 folder.
I am being lazy by not creating an installation package, forgive me.
You can be lazy too and put them in the application folder but it is not good practice.
Then the FIRST time you run Arduino_pref.exe run it as administrator and the OCX files will auto register.