   if (!sendCommand("ATDN")) return 4;
   return 5; // success
 }
-
-
+// end of SRF sleep code
+
+// Start of SRF command functions
 uint8_t enterCommandMode()
 {
   delay(1200);

  }
  return 0;
}


void setup() {
  // initialise serial:
  Serial.begin(115200);
  // Get device ID
  readJumpers();

  // Initialise the LLAPSerial library
  LLAP.init( nodeId );
  analogReference(DEFAULT);

  // Set unused digital pins to input and turn on pull-up resistor
  for(int i = 0; i< PIN_COUNT; i++ ) {
    pinMode(inPin[i], INPUT);
    digitalWrite(inPin[i], HIGH);

  }
}

// Start of Ultrasonic sensor code
boolean getRange( int *outRawDistance, int *outDistance, float *outTemperature ) {

  // 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.
  // Returns compensated, uncompensated and temperature values as reference params
  // boolean true returned form function for valid reading. false for <23cm or out of range
  // Calling function can still do checks to determine whether to use reading or not.

  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
