Example program to read HID ProxCards using the gatech BuzzCard format with a HID ProxPoint Plus 6005BG00.

Dependencies:   HID_Wiegand mbed USBDevice

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "Wiegand.h"
00003 #include "USBMouseKeyboard.h"
00004 /* Prototypes */
00005 void onCardRead();
00006 
00007 /* Globals */
00008           //(PinName pdata0, PinName pdata1, PinName pHold, void (*onCardRead)());
00009 Wiegand rfid(p30           , p29           , p28          , &onCardRead);
00010 
00011 /*
00012   hook up to a usb breakout board: D+ to D+, d- to d-, grnd to grnd
00013   If you do not have the usb breakout board for keyboard emulation,
00014   you can use Serial over USB by changing the USBMouseKeyboard line to read:
00015   Serial key_mouse(USBTX, USBRX);
00016 */
00017 USBMouseKeyboard key_mouse; 
00018 int main() {
00019     while(1) {
00020         rfid.doEvents(); //check if RFID Reader has read all data
00021     }
00022 }
00023 //function is run every time that rfid finishes reading a buzzcard
00024 void onCardRead() {
00025    uint64_t rawCardData = rfid.getBits(14,33);
00026    key_mouse.printf("%lld\r\n",rawCardData);
00027 }