I'm making a door access system - I've done this before using rs232 so I've never used the wiegand format; my question is what should I store in a database as the scanned cards read data number, Here's my code.
void loop() {
if(ScannerCount >=26){
int serialNumber=(Scanner >> 1) & 0x3fff;
int siteCode= (Scanner >> 17) & 0x3ff;
Serial.println("\n");
Serial.println("RFID READER SCAN DATA");
Serial.println(" HEX: ");
Serial.println(Scanner,HEX);
Serial.println(" 0xfffffff: ");
Serial.println(Scanner& 0xfffffff);
Serial.println(" Site Code: ");
Serial.print(siteCode);
Serial.println(" Serial Number: ");
Serial.println(serialNumber);
Scanner = 0;
ScannerCount = 0;
digitalWrite(13,HIGH);
delay(2000);
digitalWrite(13,LOW);
}
}
(your basic wiegand code.)
Here is my output to the serial console.
RFID READER SCAN DATA
HEX:
3FFDA960xfffffff:
67099286Site Code:
511Serial Number:
11595
So am I doing this right? What data should I store as the cards ID #? Thanks so much! XD