Sliding pot does not read anything other than 0 or 1023

You have probably miswired it - set slider to mid-travel and measure the resistances
to identify the wiper.