Fob reader code

Dependencies:   ID12RFID mbed

Files at this revision

API Documentation at this revision

Comitter:
foxu2798
Date:
Fri May 03 09:18:28 2013 +0000
Commit message:
fob reader code;

Changed in this revision

ID12RFID.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 1057bcaeaab9 ID12RFID.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ID12RFID.lib	Fri May 03 09:18:28 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/ID12RFID/#f04afa911cf5
diff -r 000000000000 -r 1057bcaeaab9 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri May 03 09:18:28 2013 +0000
@@ -0,0 +1,44 @@
+#include "mbed.h"
+#include "ID12RFID.h"
+
+ID12RFID rfid(PTD2); // uart rx
+Serial pc(USBTX,USBRX);
+
+int main()
+{
+    int fobflag;
+    while(1)
+    {
+        switch(rfid.read())
+        {
+        case 22311780:
+            pc.printf("Hi, Matt\n");
+            wait(3);
+            fobflag = 0X01;
+            break;
+        case 22352757:
+            pc.printf("Hi, Peter\n");
+            wait(3);
+            fobflag = 0X02;
+            break;
+        case 22319109:
+            pc.printf("Hi, Kirill\n");
+            wait(3);
+            fobflag = 0X03;
+            break;
+        case 22312052:
+            pc.printf("Hi, Hao\n");
+            wait(3);
+            fobflag = 0X04;
+            break;
+        }
+    }
+        
+    
+//    pc.printf("Hello World\n\r");
+//    while(1) {
+//        if(rfid.readable()) {
+//            pc.printf("RFID Tag number : %d\n\r", rfid.read());             
+//        }
+//    }
+}
diff -r 000000000000 -r 1057bcaeaab9 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri May 03 09:18:28 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/7e6c9f46b3bd
\ No newline at end of file