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.
Dependencies: HID_Wiegand mbed USBDevice
main.cpp
- Committer:
- cbookman3
- Date:
- 2014-04-23
- Revision:
- 2:cbbc69f00a81
- Parent:
- 1:093dffbd107b
- Child:
- 3:58f770be2eea
File content as of revision 2:cbbc69f00a81:
#include "mbed.h"
#include "Wiegand.h"
#include "USBMouseKeyboard.h"
//Serial pc(USBTX, USBRX); // tx, rx
USBMouseKeyboard key_mouse;
void onCardRead();
//(PinName pdata0, PinName pdata1, PinName pHold, void (*onCardRead)());
Wiegand rfid(p30 , p29 , p28 , &onCardRead);
int main() {
while(1) {
rfid.doEvents(); //check if RFID Reader has read all data
}
}
void onCardRead() {
uint64_t rawCardData = rfid.getBits(14,33);
key_mouse.printf("%lld\r\n",rawCardData);
}