Directly give it a connection via some small 150-200ohm resistance and use digital.read() in the code offcourse after setting pin as input.
please make sure the input is max 5v DC.
Directly give it a connection via some small 150-200ohm resistance and use digital.read() in the code offcourse after setting pin as input.
please make sure the input is max 5v DC.