How to wire Hex Switch to 4 inputs on Arduino mega

I am using an A6RS-162RF hex switch, with each output terminal wired to a digital input on the Arduino.

Each terminal has a 100 ohm resistor in series to the input pin. Simply put, is this the correct way to wire a hex switch?

The schematic is below (technically, the output terminals are wired to digital inputs on an MGM111 chip, but I'm assuming it's the same principal as using an Arduino.)

Thanks,
Anthony

lennon-pledge:
I am using an A6RS-162RF hex switch, with each output terminal wired to a digital input on the Arduino.

Each terminal has a 100 ohm resistor in series to the input pin. Simply put, is this the correct way to wire a hex switch?

The schematic is below (technically, the output terminals are wired to digital inputs on an MGM111 chip, but I'm assuming it's the same principal as using an Arduino.)

Thanks,
Anthony

No resistors needed if you declare input_pullup for the pins. They use internal resistors.

Paul

The 100 ohm resistors - I'm not sure the purpose of.

You do need to set the pins to be INPUT_PULLUP, and when that switch is closed, the pin will go LOW.