   wiegand.setPin1State(digitalRead(PIN_D1));
 }
 
-long count = 0;
+int tempSensorReads = 0;
 
 // Notifies when a reader has been connected or disconnected.
 // Instead of a message, the seconds parameter can be anything you want -- Whatever you specify on `wiegand.onStateChange()`


  //Sends the initial pin state to the Wiegand library
  pinStateChanged();
}

void reconnect() {

}

void receivedData(uint8_t* data, uint8_t bits, const char* message) {
  uint8_t bytes = (bits + 7) / 8;
  long code = 0;
  for (int i = 0; i < bytes; i++) {
    code = (code * 1000) + data[i];
  }
  char buf[15];
  //ex readout : 113086150
  ltoa(code, buf, 10);
  client.publish("domogik/cardreader", buf);
}

