How to get Array Position State with digitalRead ?

You should move the code set "var" to setup(). It should not be in the loop().