I have library called settings.h. It shows as #include "settings.h" before setup()
I would like to create 3 different settings.h, like settings1,h, settings2.h and settings3.h
And select one from a menu and use it in the main sketch. Is this possible?
Where do you want this menu to be?
Is this possible?
No. The code in files #included within a program is compiled into the program so the .h file cannot be selected later.
That is not to say that you could not write a program such that the user is prompted to select different settings at run time, but all possible values of the settings would need to be already compiled into the program, be entered by the user, read from an SD card or previously stored in EEPROM.
What is it that you are trying to do ?
How many and what type of settings are you trying to make selectable ?
It is possible if they're asking about adding a custom Tools submenu to the Arduino IDE via boards.txt. However, I think you're correct in assuming they're talking about a runtime menu in their sketch.
This question is addressing the Adafruit wireless weather station which I built some time ago. Right now it is written for my city so Weather Underground can sent the data. I would like to select another city also. Only 2 lines in the ,h file need to be changed.
The state/city line and the GMT offset line.
Only 2 lines in the ,h file need to be changed.
Forget about selecting different .h files. Make all 6 values available in the program as variables, perhaps in an array or a struct and prompt the user to choose the values to be used when the program is run.