First of all, I'm terribly sorry for being a total noob and giving up on troubleshooting this issue so quick.
So I bought a new arduino uno (not genuine) and wanted to test it, so
I wrote a very simple code that would enable me to make the onboard LED light up,
whenever I push a button on pin 8 (no real reason for choosing pin8).
I've chosen the internal pullup function, since I need it for my actual project.
My simple testcode doesn't seem to work. What am I doing wrong?
(Let's assume the led aswell as the button itself work fine)
pin8 (or pin2, copy paste mistake) is connected to the bottom right pin of the button.
The bottom left pin of the button is directly connected to Ground so whenever I push it,
it should go LOW and if I don't push it, it should stay HIGH.
the onboard LED is pin13 and is not connected otherwise.
Thanks for your quick replies btw, didn't expect to be noticed this fast.
If the switch is one of those 6mm tactile switches with 4 pins, the pins on each end are shorted internally. If you connect diagonal pins you can avoid the short.
You're right. Thanks for the headsup. Updated the code.
I attached a pic of the setup.
Please ignore the big black block in the picture. That's part of the actual project. Just a bunch of leds with resistors, not connected to anything at the moment.
(Upload failed multiple times, I'll supply a pic tomorrow. I'm very sorry.)