MCP3008 Led Dimmer

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.
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.