Programming help - Tilt switches as keyboard

PaulS:
How, EXACTLY, is the switch wired? The internal pullup resistors are not being used; God only knows why not. So, you MUST have external pullup or pulldown resistors. What value, and how are they wired?

I'm not using any resistors... I've just got the tilt switch connected to pin 2 and ground.

I'm new to electronics and my knowledge is very limited, should I be using resistors here?