XY Plotter/CNC style interpolation project. Need great deal of help

one side of the NC switch to GND the other side to the digital pin and a pullup to 5v(so that when the switch is pressed and becomes open, the pin is 5v(HIGH))