I'm using a wrapper (https://github.com/HenniePeters/ArduinoStarter) to start the Arduino 1.8.19 IDE.
Sometimes when I haven't worked on a project, I just forget the settings to make the compiler work.
This wrapper reads the settings from the comment lines in my sketch and changes the file preferences.txt.
For instance the sketch for an Arduino Pro Mini starts like this:
//exec=arduino
//root=~/.arduino15/
//board=pro
//custom_cpu=pro_16MHzatmega328
//target_package=arduino
//target_platform=avr
Since Arduino IDE 2.0 this does not work anymore. I can't find the preferences file in the path of the 2.0 IDE and I have no idea in which file to look for it. I tried to open almost every file in the path for 2.0, in an editor, but no success.
I would like to change the code to make it work again.
Has anybody found the equivalent for the micro controller settings that were stored in the preferences file in the old version of Arduino?
-
Maybe this helps: forum.arduino.cc/t/ide-2-0-preferences-txt-path/1078505 (found by a quick Google search and there is little point in repeating the contents here. BTW, it is platform dependent)6v6gt– 6v6gt07/21/2024 09:50:24Commented Jul 21, 2024 at 9:50
-
@6v6gt, Unfortunately you can only change IDE settings in those files. Custom microcontroller settings are not available in .json or .yaml files. Probably the developers have hidden these settings in some binary file. This makes the 2.0 IDE useless to me. If somebody knows where to change controller type, clock rate and other specific settings that are only available in the tools menu, please let me know.hennep– hennep07/21/2024 10:12:15Commented Jul 21, 2024 at 10:12
-
OK. I thinks I see what you are trying to do to add enough information into the sketch so that it automates the steps a user would normally make in the IDE to select the board and any menu controlled options that would normally be selected from the boards.txt file. Maybe then you could explore the mechanism of the CLI interface: arduino.github.io/arduino-cli/1.0 .6v6gt– 6v6gt07/21/2024 10:58:35Commented Jul 21, 2024 at 10:58
-
Thanks @6v6gt, The first line of "getting started" : "Arduino CLI provides all the features you can find in the Arduino IDE.". That sounds promising! But this will need some time to investigate :-)hennep– hennep07/21/2024 11:06:40Commented Jul 21, 2024 at 11:06
1 Answer 1
Arduino IDE 2.x does this automatically.
When you open a given sketch, Arduino IDE 2.x automatically selects the board, custom board options, and port you had selected the last time you had that sketch open.
-
That might be of help to some of us, but not when you work in a team. I need to add settings to the .ino file for other team members. This is a serious flaw in the Arduino IDE, it really needs a project file to store settings that also need to be distributed to other team members. I keep using the wrapper and version 1.8 of the IDE. Hopefully the developers change this in the future and add a project file like all other C++ IDE's have.hennep– hennep07/29/2024 09:11:28Commented Jul 29, 2024 at 9:11