Using Map function with a potentiometer

map(sensorValue, 0, 1023, 1, 24);

You use the map function correctly but you don't use the mapped value.