Run one of 3 "Programs" based on switch position on startup.

I have been creating a virtual cockpit for my flight simulator using Arduino and multiple I/O devices.

My latest project is building a communication and navigation radio.

I currently have compiled 2 different sketches that I manually upload based on what aircraft I want to fly. The main difference the locations of items to be displayed on MAX 7219 Nixie tube displays.

EG: Cockpit that displays standby frequencies of radios.

Active Com 1 Freq Standby Com 1 Freq Active Com 2 Freq Standby Com 2 Freq Active Nav 1 Freq Standby Nav 1 Freq Active Nav 2 Freq Standby Nav 2 Freq

EG: Cockpit that displays only the Active Frequencies.

Active Com 1 Freq Active Com 2 Freq Active Nav 1 Freq Active Nav 2 Freq DME 1 Frequency DME Speed/Distance ADF Frequency

All the variables used in both "layouts" are the same, they are declared in the setup loop.

I want to have a multi position switch (Rotary) thats position is read on startup and executes its corresponding "void loop".

If this topic has previously been covered, I apologize. I am not sure of the exact search terms I should be using.

Any shoves in the right direction would be greatly appreciated.

Basic Running procedure.

Declare all variables and initialize displays

Read position of switch. // If switch is in position 1- Run "void loop1"

Read incoming data on serial port and display on correct displays based on aircraft flown.

// If switch is in position 2- Run "void loop2"

Read incoming data on serial port and display on correct displays based on aircraft flown.

A power down of the arduino, re position the selector switch will allow for different radio layout to be used.

there can only be one loop()

create 3 functions that are called from loop() dependent on switch position.
no need to restart.

EG.

if(switchPosition ==1)
{
  standbyFreq();
}
else if(switchPosition ==2)
{
  activeFreq();
}

Something so simple, I obviously have been over thinking. Thanks for the prompt reply. Now to combine the 2 pieces of code! I think my best approach will be compile a basic program to test. If switch is in position 1, light up LED 1 If switch is in position 2, light up LED 2.

So the code in { standbyFreq(); }

will keep looping till the switch position is changed

then { activeFreq(); }

that will keep doing its thing.

etc!

Sounds like a plan. .