 boolean tempSensorFound = false;
 float latestTemperature = 0.0;
 uint16_t lastUncompDistance = 0;
+
+// Define pins that are not used and are to be made inputs
+uint8_t inPin[] = { 9, 10, 11, 12, 13 };
+
 int batteryCountDown = BATTERY_READ_INTERVAL;
 int pollingInterval = FIFTEENMINS;
 
-// Define pins that are not used and are to be made inputs
-uint8_t inPin[] = { 9, 10, 11, 12, 13 };
-
 uint8_t enterCommandMode();
-
 // Node ID, default 00, set by input pins
 // Stricly speaking this should only be digits, according to the Ciseco LLAP spec.
 char nodeId[2] = { '0', '0' };

  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)
