I'm totally new to Arduino and to electrodynamics in general.
I'm wondering what happens if I connect my digital pin to an analog input on Arduino, and make digitalWrite and analogRead on the according pins. Here are the options I can think about:
- Just connect them directly - it is not a short circuit, is it?
- Connect a resistor in between - the voltage should still be 5v, right? Whatever resistor I use?
- Make a circuit: digital output -> resistor -> ground, and connect the analog input in parallel (in between the resistor and ground) - Does it make sense? What is the difference with the previous option?
As you see, I'm really confused now. I would highly appreciate if someone could explain in detail what is happening in all the cases, with corresponding values for the current, voltage and resistance.