Well I have 4 cases for the dip switch. I want to check through the four pins to verify which one is open to change the switch var accordingly.
For a choice of 4 values of var , you need only 2 dip switches. 4 dip switches actually gives you 16 cases:
0000
0001
0010
0011
0100
etc.
What value should var have if none of the dip switches is set ?