Best way to switch between functions


I am working on a project using Arduino Uno. It is a project to control the lighting level inside a room. The project is designed to work on the automatic way or the manual way. On the automatic way Arduino will determine which lamps must be turned on/off and control a servo motor. On the manual way the user will turn lights on/off via buttons and manage the servo via potentiometer.

Via a switch connected to 5V with resistor, the user will be able to select which mode Arduino will execute. So if pin2 is high Arduino will execute the automatic function and if pin2 is low Arduino will execute the manual function.

What is the best way to switch between these two functions? I suppose I should use external interruptions but ISR cant use for-loops and I need them to read from photosensors...

ISRs are used when you need to do something very quick, very quickly. What you want to do is something that will (from the MCU's point of view) take ages and the chip can take as long as it wants. There is no urgency in this.

A simple if else statement is more than enough for this application.