No it's not your fault

I will try with just a regular switch and then see what happens

What resistor should I use for connecting a switch to a pin?