Go Down

Topic: Board Settings in *.ino file (Read 28740 times) previous topic - next topic



Yep, it seems like a good idea to most but slow to be adopted.
I still use my little exe that I made public, so not sure why people still talk about wanting something similar.!


This is definitely a great idea. Now I included all settings in each Sketch by hand. Kind of stupid. For a computer task.
Spent a lot of time figuring out what the optimal board settings were. Esp8266's,
Nano's with old and new bootloader, Pro Minis,  Tasmota devices, etc. Multiple project switches a day.
Don't get it why this is not provided yet.


Jun 15, 2020, 11:00 pm Last Edit: Jun 15, 2020, 11:01 pm by Hiddenvision
There was a solution though not the best option perhaps it works perfect for me.




I'd like to for the board and port (at least the board) be saved.  I work with different projects with different boards.  As an example currently working with one project with an ESP32 and another with a MKR1500.  If I compile one and then open the other board I get compile errors.  It's not a big deal but sometimes when you've been away from using multiple projects it takes a little head scratching to realize the compiler errors are because the wrong board is being used.  I see one solution is to move to Eclipse with the plugin.  So there is a solution but there are things I like better with the IDE over Eclipse.  Maybe there is a solution to this that I've not uncovered in my searching?  It seems that something simple such as a file with named projectx.prj (or whatever) could be created in the same directory as projectx.ino  to save the configuration. 


Hey Icole,
It is such an easy thing to be fixed by the developers if desired but here we are many years later in the same situation.

It is easy enough to do manually if you want , you simply copy the preference file before you start your project.
That is what my little program does and for me this is a non issue since writing it.

I guess if I were part of the development team I would have added it to the core but we are where we are and given the uptake of a free solution (very little) I can see why the developers perhaps do not see the need to put in the effort.

all the best.



Topic reopened at the request of @monok
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.


Cool, I guess we can talk about it some more


Cool, I guess we can talk about it some more
Feel free

monok obviously thinks that he has something to add
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.


Hi, Adrianotiger, your application looks good. Yet, from the application's readme on GitHub I don't know how to build/compile it with "Visual Studio Code" on Windows. Is compile an option, how would I call the application then?
Btw, I crashed 2 Sparkfun Pro Micros, because I uploaded the code with the wrong board chosen...... so I think your application would help.


I have created a Extension that takes the board settings and saves them with the sketch. Then when the sketch loads it loads the board settings that was saved before.
It  is a work in progress.


Its working just like post #29
But this is a tool-plugin that is written In java and is automatically loaded inside the arduino ide, and therefore is compatible with all os like PC/Linux/mac/raspberry pi. At first it worked flawless except that the menu choices didn't update, then I called the functions that involved updating the menu, then it was buggy, now I think I have a complete solution, that I will soon try.
One note how the prefs are stored. There is only one instance of the board settings, that means if your have many sketches open at the same time and change the board settings that new board setting is then used by all open sketches automatically.


Shamed that this feature are not present as default. As everyone having at least two different boards really need that.


By the way its working flawless now, it also have functionality to automatically close other open editor(s) (from the same instance)
I.e. when open a existing sketch that have the prefsaver enabled, then the prev sketch is automatically closed.


I have created a IDE plugin that takes the board settings and saves them with the sketch.
Plugin page on github
Please download it from release page, test it and send me feedback.

Format of saved board is compatible with arduino-cli.
New comment block:
Code: [Select]
/* Boards:
 * - My Uno R2 * arduino:avr:uno:CONSOLEBAUD=115200
 * - My nano * arduino:avr:nano:cpu=atmega328old,CONSOLEBAUD=19200
 * - ESP Wemos D1 mini * esp8266:esp8266:d1_mini:baud=460800,xtal=80,eesz=4M2M,dbg=Disabled,lvl=None____,ip=lm2f,vt=flash,exception=legacy,wipe=none,ssl=all,CONSOLEBAUD=115200
 * - Anet A6 * anet:avr:anet:CONSOLEBAUD=115200
 * - BBC Microbit * sandeepmistry:nRF5:BBCmicrobit:softdevice=s110,CONSOLEBAUD=115200

Go Up