 // This reads a magnetic door sensor. At least with this style
 // the sensor is normally open and the circuit closes when the
 // two sensors are next to each other.
+//
+// Connect one wire to digital and other to ground
+//
+// TEMP421 code thanks to http://ka1kjz.com (my bookmark no longer points to the source
+// posting though, should still be on there somewhere
+// TEMP421 pinout (pins are counted if sensor is on right):
+// D - pin3
+// G - pin1
+// + - pin2
+// A - pin4
 
-// Connect one wire to digital and other to ground
 
 #include <JeeLib.h>
 

    batt_loop_count++;
  }

#ifdef DEBUG
  if (door_status_4 == DOOR_OPEN) {
    DEBUG_PRINT("Door open");
  }
  else {
    DEBUG_PRINT("Door closed");
  }
#endif

  tempc = get_temperature(temp_dev1);
  DEBUG_PRINT(tempc);

  payload[0] = has_lowbat;
  payload[1] = int(tempc * 100);



void setup() {
  if (DEBUG){
    Serial.begin(57600);
  }
  debug_print("Initializing");

  rf12_initialize(NODE_ID, RF12_915MHZ, NETGROUP);

  // Do this so the initialize the thermometer (which starts at 0.00)
  float _unused = get_temperature(temp_dev1);
  delay(200);
  
  pinMode(DIO4, INPUT_PULLUP);  
}


