How do I program an NC switch?

Hi, I wouldn't ask such an elementary question if I didn't have such a hard time finding the answer.

It's my understanding that the ubiquitous little 6mm momentary buttons are most often NO switches, so they must be set to INPUT_PULLUP, otherwise pulling it to ground (without additional resistors) will damage the the board. These are the ones I'm used to using.

I have acquired a few NC buttons, and I want to make sure that I'm not damaging the board by using them. If I'm using NC buttons, do I just switch from INPUT_PULLUP to INPUT in pinMode? Is there anything else that I need to do apart from inverting all of my "LOW" to "HIGH" and vice versa? Do I need to use external resistors if it's an NC switch?


Same difference. A switch is a switch.
Doesn't matter if you push-hold a NO switch, and periodically release it,
or use a NC switch, and periodically push it.

Just wire the switch between pin and ground, and use INPUT_PULLUP.
A NC switch will then read normally LOW, and HIGH when pushed.

There is one difference to be aware of but might not matter: if you use a NC button then the pull up resistor has current flowing through it all the time, except for the brief moment you press the button. For mains powered projects this won't matter but if you are using batteries it will reduce battery life.

otherwise pulling it to ground (without additional resistors) will damage the the board.

It depends on 'what' is being pulled to ground, and also what devices or power sources etc is connected to whatever is being pulled to ground.

All wonderful advice, nice direct answers, thank you everybody. Feeling a lot more confident about it now. There's a wealth of information about the difference between the two out there, but sometimes a wealth of information obscures a simple answer :D. Hopefully anybody wondering in the future finds this thread!