 #endif
   DEBUG_PRINT("Initializing");
 
-  rf12_initialize(2, RF12_915MHZ, 100);
+  rf12_initialize(NODE_ID, RF12_915MHZ, NETGROUP);
 
-  pinMode(DIO4, INPUT);
-  digitalWrite(DIO4, HIGH);  // turn on pull up
+  pinMode(DIO4, INPUT_PULLUP);
 }
 
+
 void loop() {
+  float tempc = 0;
   int door_status_4 = digitalRead(DIO4);
   word payload[4] = {0,0,0,0};
 

ISR(WDT_vect) { Sleepy::watchdogEvent(); }


//#define DEBUG          // Comment out to disable
#define JEELINK_ID 1   // Jeelink is id 1 (or 0 to broadcast)
#define NETGROUP 100   // Netgroup everyone is on
#define NODE_ID 2      // id of THIS node

#define DOOR_OPEN 1    // 1 means open
#define DOOR_CLOSED 0  // 0 means closed
#define DIO_OFFSET 3   // DIO is port num + 3

//Basic macro for debugging
#ifdef DEBUG
  #define DEBUG_PRINT(x) Serial.println(x)
#else
  #define DEBUG_PRINT(x)
#endif

// TEMP421 code thanks to http://ka1kjz.com (my bookmark no longer points to the source
// posting though, should still be on there somewhere

  }
#endif

  tempc = get_temperature(temp_dev1);
  DEBUG_PRINT(tempc);
  payload[0] = int(tempc * 100);

  rf12_sleep(RF12_WAKEUP);
