Measuring ambient temperature with an analog sensor