   }
   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;
-  
-
+  analogReference(DEFAULT);
 
   // Set unused digital pins to input and turn on pull-up resistor
-  analogReference(DEFAULT);
   for(int i = 0; i< 5; i++ ) {
     pinMode(inPin[i], INPUT);
     digitalWrite(inPin[i], HIGH);

  digitalWrite(12, HIGH);
  digitalWrite(13, HIGH);
  
  // Set individual registers
  // TODO: Explain these
  int digit2 = ((PINB & 0x30) >> 4) | ((PINC & 0x03) << 2);
  digit2 ^= 0x0f;
  int digit1 = (PINC & 0x3c) >> 2;
  digit1 ^= 0x0f;

  // set Node ID from jumper pins
  nodeId[0] = '0' + min(digit1,9);
  nodeId[1] = '0' + min(digit2,9);
  
  // set polling interval from jumper pins
  pollingInterval = ((PINB & 0x06) >> 1) ^ 0x03;


  // DEBUG to serial port
  // Print the values of Port B & Port C
  Serial.println("Debug: ");
  Serial.print("Port B: ");
  Serial.println(PINB,HEX);

#define SRF_SLEEP 4
#define WAKE_INT 2

// Data wire is plugged into port 5 on the Arduino
#define ONE_WIRE_BUS 5

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
