Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
You are viewing an older revision! See the latest version
Homepage
Description¶
This is a Wiegand card reader interface library.
Information
Todo - parity checking.
Example¶
#include "mbed.h" #include "ReaderWiegand.h" Serial gSerial(USBTX, USBRX); ReaderWiegand gReader(p10,p11); int main() { gSerial.printf("Ready\r\n"); while(1) { if(gReader.isNew()) { uint8_t bq = gReader.bitCount(); uint64_t bits = gReader.bits(); for(uint8_t i=0; i<bq; i++) gSerial.printf("%c",'0' + ( ( bits & ( (uint64_t)1 << i ) ) != 0)); gSerial.printf(" bq: %u h: 0x%llX ",bq,bits); if(gReader.isValid()) gSerial.printf("f: %lu, c: %lu\r\n",gReader.facility(),gReader.card()); else gSerial.printf("Unknown format\r\n"); gReader.old(); } } }