Switch case variable not updating

westfw:
Meh. I'm with TomGeorge. "pinMode(pin, INPUT_PULLUP)" is clear, obvious, and portable to any device that implements internal pullups in some way (perhaps with a bit of effort.)

Right, what's the value added of using some device-specific code just to set the pin to input mode and turn on the pullup? How many times are you going to do that in a program? Who cares how long THAT takes?

(Did you know that the SAMD chips have an entirely different way to enable pullups, but go to significant expense inside digitalWrite() to duplicate the AVR behavior? That's one of the reasons that digitalWrite() on the Zero isn't 3x faster than Uno's digitalWrite(), despite the 3x higher clock rate. Grr.)

I'm more familiar with the freescale chips used in the Teensy family. They have some blindingly fast, device family-specific methods for digital I/O -- if you need it. The direct I/O techniques in the encoder and OneWire libraries come to mind. I assume the SAMD chips have similar device-specific facilities. But, again, if you don't need the speed, go with something easy to understand and portable.