using toggle switch

hello i have toggle switch like MTS-203
and i want to count with toggle switch

this is code that i make

const int toggle1 = 8;
const int toggle2 = 9;
volatile byte count1;
volatile byte count2;

void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(toggle1,INPUT);
pinMode(toggle2,INPUT);
count1 = 0;
count2 = 0;

}

void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(toggle1)==LOW) {
count1++;
}
if (digitalRead(toggle2)==LOW) {
count2++;
}
Serial.print("count1 = ");
Serial.println(count1,DEC);
Serial.print("count2 = ");
Serial.println(count2,DEC);

}

and this is my board

and then that is Execution window

i wonder what’s matter

please give me help

실행창.PNG

When the switch is to the right, as in your diagram, how do you know what the voltage is on the left hand pin ?

You need a pull up resistor on each pin (8 & 9) to 3.3 or 5 volts (what ever the due takes).