Hi everyone, I am new to the forum.
I have a relay that has a ground trigger, that is supposed to output 5V to the Arduino when triggered. The issue is that, since the switch is not grounded until it is closed, this means that I have a floating input when it is open. Thus when calling analogRead, I get a high value regardless of whether the relay is open or closed. Suggestions? Would calling pinMode(INPUT_PULLUP) solve the issue, or would I need some additional component? I am using an Arduino Leonardo by the way.