Map function weird behaviour

Have you tried printing TPSReading before using the map() function ?

What exactly is connected to the analogue input ?