asdasdasd

Dependencies:   mbed

Fork of FINAL_PROJECT_4180 by Gedeon Nyengele

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);        
+    }
 }