   }
   return 0;
 }
-
-
+// End of SRF command functions
+
+// BEGIN
 void setup() {
+
   // initialise serial:
   Serial.begin(115200);
+
   // Get device ID
   readJumpers();
+
   // Initialise the LLAPSerial library
   LLAP.init( nodeId );
+
+  // Initialise countdown for number of sleeps before sending battery reading
+  batteryCountDown = BATTERY_READ_INTERVAL;
+  
+
+
+  // Set unused digital pins to input and turn on pull-up resistor
   analogReference(DEFAULT);
-
-  // Set unused digital pins to input and turn on pull-up resistor
   for(int i = 0; i< 5; i++ ) {
     pinMode(inPin[i], INPUT);
     digitalWrite(inPin[i], HIGH);

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


uint8_t enterCommandMode()
{
  delay(1200);

  digitalWrite(12, LOW);
  digitalWrite(13, LOW);
}


// **************************************
// Functions used in processing readings
