[SORTED] - Weird board symptoms with basic sketches

What you lack are either pull-up or pull-down resistors, depending on how you connect the switch. Just wiring a momentary switch to 5V and an input won't work.