Converting potentiometer value to time