         LLAP.sendMessage( "UErr" );
       }
     }
-
-}
-
-// The main loop, we basically wake up the SRF, take a reading, transmit reading then go back to sleep
-void loop() {
+  }
 
   // Short delay to allow reading to be sent then sleep
   delay(50);
   pinMode(SRF_SLEEP, INPUT);                // sleep the radio
   LLAP.sleep(WAKE_INT, RISING, false);      // sleep until woken on pin 2, no pullup (low power)
   pinMode(SRF_SLEEP, OUTPUT);               // wake the radio
-  
-  // Determine if we need to send a battery voltage reading or a distance reading
-  if( --batteryCountDown <= 0 ) {
-    int mV = readVcc();
-    LLAP.sendIntWithDP("B", mV, 3 );
-    batteryCountDown = BATTERY_READ_INTERVAL;
-  } 
-  else {
-
-    // Distance reading
-    uint16_t cm = getRange();
-    // Send temperature reading
-    if( tempSensorFound ) {
-      int latestTemp = (int)(latestTemperature * 100);
-      LLAP.sendIntWithDP( "T", latestTemp, 2);
-    }
-    // Uncompensated distance
-    LLAP.sendInt( "D", lastUncompDistance);
-    // Send reading 3 times to make sure it gets through
-    for(int n = 0; n<1; n++ ) {
-      if( cm > 17 ) {
-        LLAP.sendInt( "U", cm );
-      } 
-      else if( cm == 0 ) {
-        LLAP.sendMessage( "UMax" );
-      } 
-      else {
-        LLAP.sendMessage( "UErr" );
-      }
-    }
-  }
+
 }
 // That's all folks
 

    LLAP.sendInt("ERR",val); // Diagnostic
    delay(5000);	// try again in 5 seconds
  }
  for(int i=0;i<3;i++) {
    LLAP.sendMessage("STARTED");
  }



    // Initial Distance reading
    uint16_t cm = getRange();
    // Send temperature reading
    if( tempSensorFound ) {

// Some functions to get the configured node address and polling
void readJumpers() {
  // Set analog input pins to read digital values, set internal pullup
  // TODO: ugly - refactor in loop.
  pinMode(A0, INPUT);
  pinMode(A1, INPUT);
  pinMode(A2, INPUT);
