Created
August 16, 2015 12:57
-
-
Save kendx/01c5b48006862d5dc19d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Arduino and RDM630 RFID module | |
* www.KendrickTabi.com | |
* http://www.kendricktabi.com/2015/04/arduino-and-rdm630-rfid-module.html | |
*/ | |
#include <SoftwareSerial.h> | |
SoftwareSerial RDM630 = SoftwareSerial(2,3); // RFID | |
char rfid; | |
String dx; | |
void setup() { | |
Serial.begin(9600); | |
RDM630.begin(9600); | |
} | |
void loop() { | |
while(RDM630.available()>0) { | |
rfid = RDM630.read(); | |
dx += rfid; | |
} | |
if (dx.length() > 10) { | |
dx = dx.substring(1,13); | |
Serial.print("RFID code: "); | |
Serial.println(dx); | |
} | |
dx = ""; // clear | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment