     uint16_t newDist = tof * (( 20.05 * sqrt( temperature + 273.15))/2);
     distance = newDist;
   }
-//  digitalWrite(TEMP_SENSOR_ENABLE, LOW);
-
   return distance; 
 }
 

/** 
 * LLAPDistance_Remote sketch for Ciseco RFu-328 and Maxbotix XL-EZ3 ultrasonic sensor
 * Availabe form http://www.coolcomponents.co.uk/ultrasonic-range-finder-xl-ez3.html
 *
 * Transmits reading every 5 minutes
 * Data transmitted is of form aXXUnnn-----
 * Battery readings every 10th cycle  aXXBvvvv----
 *
 * Where XX is the device ID, nnn is the distance to the water in cm, vvvv is battery voltage in mV
 * Other messages sent are: aXXSTARTED upon startup
 * aXXUMax----- and aXXUErr----- if max range is reached or an error in the reading is seen.
 *
 * Sensor is controled using a single N-Channel MOSFET, Gate to SENSOR_ENABLE,
 * Source to GND, Drain to -ve of sensor, Sensor +ve to +3V.

#include <OneWire.h>
#include <DallasTemperature.h>

#define VERSION_STRING "V0.9"

// Number of readings before a battery reading is taken
#define BATTERY_READ_INTERVAL 10
