Code for RFID Robot

Dependencies:   DebounceIn HTTPClient ID12RFID SDFileSystem TextLCD WiflyInterface iniparser mbed

Revision:
0:9fd64882c5aa
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/RFID.cpp	Tue Dec 10 02:17:48 2013 +0000
@@ -0,0 +1,46 @@
+#include "RFID.h"
+
+//Takes in vector by reference and populates it with unique RFID values
+//until pb21 is pressed.
+int readTagSequence(std::vector<int>& v)
+{
+   int currTag;
+   int size = 0;
+   printLCD("Scan tag", NULL);
+   while (select) {
+       if(rfid.readable()) {
+           currTag = rfid.read();
+           size++;
+           v.resize(size);
+           v[size-1] = currTag;
+           char line1[16];
+           sprintf(line1, "%d", v[size-1]);
+           printLCD(line1, "added to list");
+           wait(1.5);
+           printLCD("Scan tag", NULL);
+       }
+       else if(!back) return 0;
+   }
+   return 1;
+}
+
+//Reads a single RFID tag, and returns value
+int readTag()
+{
+   printLCD("Scan tag", NULL);
+   int currTag = 0;
+   while (!currTag) {
+       if (rfid.readable()) {
+           currTag = rfid.read();
+           char line1[16];
+           sprintf(line1, "%d", currTag);
+           printLCD(line1, "read");
+           wait(1.5);
+           return currTag;
+       }
+       else if (!back) {
+           return 0;
+       }
+   }
+   return currTag;
+}
\ No newline at end of file