How to read analog value from Raspberry Pi using LED as an output device and potentiometer as an input.

Connect all part as on scheme and image.