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?

Potentiometer works as a voltage divider with current flowing mainly through Z1 and Z2: https://en.wikipedia.org/wiki/Voltage_divider
– IOB Toolkit Team Jan 31 '16 at 11:18