What could be the reason for the error?
So to use pin 0 as a switch input you should just be able to wire the switch from ground to the input pin. When switch is pushed your digitalRead() will return a zero and a one when not pushed. Try it and see if that doesn't work better for you.
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16