I am now struggeling for over 2 weeks getting an input from a tactile switch (button), which is connected to ground via resistor on a ps5 controller.
That means I am trying to read the value of the input and do something with the value in my code.
I could use INPUT or INPUT_PULLUP, but if I use INPUT_PULLUP, I am getting a reading of HIGH, which is not optimal, because the button will be pressed even if I dont press it.
When I use INPUT, I am getting a reading of 0 (LOW), which wont change, even when I press the button.
I tried everything, it is a bit harder, because the button is not actually in contact with ground on the microcontroller and not directly connected to ground on the ps5 controller (only through resistor).
Actually the ground of the microcontroller and the ps5 controller are connected. I forgot to mention, that I am running the atmega328P-au standalone, it is running on 8Mhz.
It seems like the tactile switch of the analog sticks on the ps5 controller (L3 and R3) are only connected to ground when there is some voltage.
I connected the one leg (not the voltage legs) of the tactile switch to pin 10 on the microcontroller.
@awneil
You've taken this out of context. That drawing is one many of us refer to when sorting pushbutton issues for Newbies. It's original author, I think, was @LarryD. That note is a reference to the common issue of distributing +5V around a chassis or circuit for pushbuttons, and refers to the risk of shorting that +5V to other objects, causing damage.
In a grounded chassis or circuit box, it's an issue.
Generally, distributing GND for the same purpose has less risk(because the box is generally grounded, for shielding purposes, anyway), though we can argue that some other time. It is, admittedly, a minor point.