user16764: I have a question regarding potentiometer example:
https://www.arduino.cc/en/Tutorial/AnalogReadSerial

If I turn the potentiometer to the marginal position and have 5V at A0 (and almost zero resistance at the pot), what limits the current flowing through the circuit?

user10794: Assuming A0 is set to input then it is a high-impedance input. That is, the input has a high resistance, and only consumes enough current to "sample" the voltage.

user16458: A0 input is high impedance, so very little current is flowing into A0. The value is so small that you can simplify that it flows only from +5V through the potentiometer to GND.
For some applications, when you are measuring high-impedance sources (a source that can deliver very little current) this simplification may not be correct.
You can find more detailed explaination in Atmel application note:
http://www.atmel.com/images/atmel-8456-8-and-32-bit-avr-microcontrollers-avr127-understanding-adc-parameters_application-note.pdf

16764: <p>I have a question regarding <em>potentiometer example</em>:</p>

<p><a href="https://www.arduino.cc/en/Tutorial/AnalogReadSerial" rel="nofollow noreferrer">https://www.arduino.cc/en/Tutorial/AnalogReadSerial</a></p>

<p><a href="https://i.stack.imgur.com/fYM1t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fYM1t.png" alt="enter image description here"></a></p>

<p>If I turn the potentiometer to the marginal position and have 5V at A0 (and almost zero resistance at the pot), what limits the current flowing through the circuit?</p>
 10794: <p>Assuming A0 is set to <strong>input</strong> then it is a high-impedance input. That is, the input has a high resistance, and only consumes enough current to "sample" the voltage.</p>
 16458: <p>A0 input is high impedance, so very little current is flowing into A0. The value is so small that you can simplify that it flows only from +5V through the potentiometer to GND.</p>

<p>For some applications, when you are measuring high-impedance sources (a source that can deliver very little current) this simplification may not be correct.</p>

<p>You can find more detailed explaination in Atmel application note:</p>

<p><a href="http://www.atmel.com/images/atmel-8456-8-and-32-bit-avr-microcontrollers-avr127-understanding-adc-parameters_application-note.pdf" rel="nofollow">http://www.atmel.com/images/atmel-8456-8-and-32-bit-avr-microcontrollers-avr127-understanding-adc-parameters_application-note.pdf</a></p>
