Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Seeedstudios 125kHz RFID reader Example
void setup(){
Serial.begin(9600);
Serial1.begin(9600);
}
void loop(){
char code[10];
int bytesread = 0;
while(Serial1.available() > 0){
int val = Serial1.read();
if(val == 2){
bytesread = 0;
while(bytesread < 10){
if(Serial1.available() > 0){
val = Serial1.read();
code[bytesread] = val;
bytesread++;
}
}
if(bytesread == 10){
Serial.println(code);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment