Skip to content

Instantly share code, notes, and snippets.

@kendx
Created August 16, 2015 12:57
Show Gist options
  • Save kendx/01c5b48006862d5dc19d to your computer and use it in GitHub Desktop.
Save kendx/01c5b48006862d5dc19d to your computer and use it in GitHub Desktop.
/*
* 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