   pinMode(SENSOR_PIN, INPUT);
 
   // Setup the SRF pins
-  pinMode(SRF_RADIO_ENABLE, OUTPUT);    // initialize pin to control the radio
+  pinMode(SRF_RADIO_ENABLE, OUTPUT);    // initialize pin 8 to control the radio
   digitalWrite(SRF_RADIO_ENABLE, HIGH); // select the radio
   pinMode(SRF_SLEEP, OUTPUT);
   digitalWrite( SRF_SLEEP, LOW );
 
-  sensors.begin();                      // start OneWire sensors
-  tempSensorFound = false;              // clear flag for sensor discovery
-  
-  // Discover OneWire temperature sensor
+  sensors.begin();
+  tempSensorFound = false;
   if (sensors.getAddress(temperatureSensor, 0)) {
-    // If we find a sensor, set the resolution to 9 bit 
-    // (Each Dallas/Maxim device is capable of several different resolutions)
+    // set the resolution to 9 bit (Each Dallas/Maxim device is capable of several different resolutions)
     sensors.setResolution(temperatureSensor, 9);
-
-    tempSensorFound = true;             // set discovery flag
-  }
-  delay(200);                           //   Wait for sensor to be initialised
-
-  // Send "STARTED" message if successful or "ERR" if not able to set SleepMode 3.
+    tempSensorFound = true;
+  }
+
+  batteryCountDown = BATTERY_READ_INTERVAL;
+  // Wait for it to be initialised
+  delay(200);
+
+  // Send STARTED message if successful or ERROR if not able to set SleepMode 3.
   // set up sleep mode 3 (low = awake)
   uint8_t val;
   while ((val = setSRFSleep()) != 5)

  }
}

// Start of Ultrasonic sensor code
uint16_t getRange() {
  // Get the range in cm. Need to enable sensor first then wait briefly for it to power up
  // Also request temperture sensor, if previously detected, to take a reading.
  // Disable sensor after use.
  
  int16_t pulse;  // number of pulses from sensor
  int i=0;
  // These values are for calculating a mathematical median for a number of samples as

  if (!sendCommand("ATDN")) return 4;
  return 5; // success
}


uint8_t enterCommandMode()
{
  delay(1200);
