[Solved] Digital read value floating between 1 and 0

The circuit is not properly wired on the breadboard, if the image can be trusted.

Central holes are connected vertically (five at a time) on the breadboard. Look at the diagram on the page you linked.

In addition there are two possible orientations for the switch, one of which is wrong.