RFID/Arduino Uno interfacing
our team is currently working on a RFID based automatic door opener for our Senior Project. We have set the code and are reading the correct/incorrect key fobs correctly....some of the time. we have tried to manipulate the code in numerous ways and are completely out of ideas. is there anything that we are overlooking? anyone else come across this? i can get into more detail about the specific coding if necessary.
-Wade
-Wade

Comments
// Requires Arduino 1.0 IDE or later #include <SoftwareSerial.h> byte rxData = 0; byte rfidBytes = 0; // Current index for buffer char rfidArray[10]; // RFID buffer (10 bytes) #define Rx 7 // SOUT pin #define Tx 255 // No pin #define enable_pin 6 // /ENABLE pin SoftwareSerial RFID = SoftwareSerial(Rx, Tx); void setup() { Serial.begin(9600); RFID.begin(2400); // Comm with reader pinMode(enable_pin, OUTPUT); // Make enable pin an output delay(200); } void loop() { if(RFID.available() > 0) { // Check if reader is sending data if((RFID.read()) == 0x0a) { // Validate for header character rfidBytes = 0; while(rfidBytes <= 10) { // Get 10 bytes from reader if(RFID.available() > 0) { rxData = RFID.read(); rfidArray[rfidBytes++] = rxData; // Collect 10 bytes into buffer } } Serial.print("ID: "); // Print out RFID code Serial.println(rfidArray); digitalWrite(enable_pin, HIGH); // Deactivate reader delay(1000); // 1 second delay RFID.flush(); digitalWrite(enable_pin, LOW); // Activate reader } } }-- Gordon