RFID communications by wire

Dependencies:   ID12RFID mbed

.

Files at this revision

API Documentation at this revision

Comitter:
codabash
Date:
Thu May 02 10:22:05 2013 +0000
Commit message:
1st go.

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ID12RFID.lib	Thu May 02 10:22:05 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/simon/code/ID12RFID/#f04afa911cf5
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu May 02 10:22:05 2013 +0000
@@ -0,0 +1,67 @@
+#include "mbed.h"
+#include "ID12RFID.h"
+
+Serial pc(USBTX, USBRX);
+ID12RFID rfid(PTD2); // uart rx
+Serial talky(PTC4, PTC3);
+
+DigitalOut l1(LED1);
+DigitalOut l2(LED2);
+DigitalOut l3(LED3);
+
+
+
+int main() {
+l1=1;
+l2=1;
+l3=1;
+
+    pc.printf("\r Hello BEAUTIFUL!\n");
+    while(1) {
+    
+        if(rfid.readable()&& talky.writeable()) {
+            int c=rfid.read();
+            l2=1;
+            l1=!l1;
+            wait(0.01);
+            pc.printf("\r RFID Tag number : %d\n", c);        
+               
+//               l1=!l1;
+               talky.printf("%d\r ", c);
+                wait(0.1);
+//            l1=!l1;
+            l1=!l1;
+        }
+        else { 
+        l1=1;l2=0;}
+    }
+}
+//
+//DigitalOut l1(LED1);
+//DigitalOut l2(LED2);
+//DigitalOut l3(LED3);
+//
+//
+//int main() {
+//
+//l1=1;
+//l2=1;
+//l3=1;
+//    while(1) {
+//    if (pc.readable() && talky.writeable()){
+//    char c = pc.getc();
+//    l1=!l1;
+//    talky.putc(c);
+//    wait(0.01);
+//    l1=!l1;
+//    }
+//    if (talky.readable() && pc.writeable()){
+//    l2=!l2;
+//    char c2 = talky.getc();
+//    wait(0.01);
+//    l2=!l2;
+//    pc.putc(c2);
+//        }  
+//    wait(0.01);
+//    }
+//}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu May 02 10:22:05 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/7e6c9f46b3bd
\ No newline at end of file