I'm setting up a detection loop. The loop is a simple 5V circuit between the Arduino Uno GND and 5V pins.
Included in this circuit is a LED and resistor to give a visual indication of a closed circuit.
If the circuit would be interrupted the LED would not light up anymore. Now that wasn't so hard.....
What I would like to do is the detect a HIGH/LOW transition on one of the digital pins.
Most likely I will need a 10k resistor in between.
Is the figure below correct? Or am I failing somewhere?
If you need to build it, swap the spot of the switch. Move the switch between the led and GND, skip the resistor and enable the pull up's in the Arduino (pinMode(pin, INPUT_PULLUP); )