 };
 
 // rfm12b radio
-int interPacketDelay = 1000; //wait this many ms between sending packets
 char input = 0;
 RFM12B radio;
 

  oneWireSensors.requestTemperatures();
  sensorData.tempInsideC = oneWireSensors.getTempC(thermometerInside);
  sensorData.tempOutsideC = oneWireSensors.getTempC(thermometerOutside);

  // enable access to sensor data  
  sensorData.available = true;

    }
  }
  
  // generate outbound messages
  if ((int)(millis()/TRANSMITPERIOD) > lastPeriod) {
    lastPeriod++;
    
    // assemble sensor reading message
    int decBatteryVoltage = int(sensorData.batteryVoltage);
    unsigned int fracBatteryVoltage;
    if(sensorData.batteryVoltage >= 0) {
        fracBatteryVoltage = (sensorData.batteryVoltage - int(sensorData.batteryVoltage)) * PRECISION;
    } else {
        fracBatteryVoltage = (int(sensorData.batteryVoltage) - sensorData.batteryVoltage) * PRECISION;
    }
    int decTempInsideC = int(sensorData.tempInsideC);
    unsigned int fracTempInsideC;
    if(sensorData.tempInsideC >= 0) {
        fracTempInsideC = (sensorData.tempInsideC - int(sensorData.tempInsideC)) * PRECISION;
    } else {
        fracTempInsideC = (int(sensorData.tempInsideC) - sensorData.tempInsideC) * PRECISION;
    }
    int decTempOutsideC = int(sensorData.tempOutsideC);
    unsigned int fracTempOutsideC;
    if(sensorData.tempOutsideC >= 0) {
        fracTempOutsideC = (sensorData.tempOutsideC - int(sensorData.tempOutsideC)) * PRECISION;
    } else {
        fracTempOutsideC = (int(sensorData.tempOutsideC) - sensorData.tempOutsideC) * PRECISION;
    }
    sprintf(buffer, "0x%02x:0x%02x:%x:%d.%02d:%d.%02d:%d.%02d", 
      CMD_READING, 
      sensorData.ldr, 
      sensorData.hall,
      decBatteryVoltage, fracBatteryVoltage,
      decTempInsideC, fracTempInsideC, 
      decTempOutsideC, fracTempOutsideC);
    Serial.print("reading [");
    Serial.print(buffer);
    Serial.print("]");

    // send sensor reading message to gateway    
    radio.Send(GATEWAYID, buffer, strlen(buffer), true);
    Serial.print(" - waiting for ACK...");
    if (waitForAck(GATEWAYID)) Serial.println("ok!");
    else Serial.println("nothing...");

    blink_led(DPIN_RF_LED, 5);
    log();
  }
