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.
Diff: main.cpp
- Revision:
- 1:0e5e9821d89d
- Parent:
- 0:f0e40bf44ffe
- Child:
- 9:48e93bcd1d5c
--- a/main.cpp Sun Apr 24 23:30:27 2016 +0000 +++ b/main.cpp Sun Apr 24 23:37:04 2016 +0000 @@ -1,6 +1,20 @@ #include "mbed.h" +#include "lib.h" + +Serial mag_card(p13, p14); +Serial pc(USBTX, USBRX); -int main() { - +int main() +{ + char card_data[250]; + int bytes_read; + int hash; + + while (true) { + read_mag_card(&mag_card, card_data, &bytes_read); + hash = hashcode(card_data, bytes_read); + pc.printf("Bytes read: %d\n\rHash Code: %d\n\r", bytes_read, hash); + wait(2); + } }