char character;
String our_id;
void setup()
{
Serial.begin(9600);
}
void loop(){
while(Serial.available()>0) // rfid okuyucudan bilgi akisi varsa
{
character = Serial.read();
our_id += character;
}
if (our_id.length() > 10) {
tone(P1_5,2500,400);
our_id = our_id.substring(1,13);
if(our_id == "05002F49F093")
{
Serial.println("Ikinci kart okundu!");
}
if(our_id == "05002F4A3D5D")
{
Serial.println("Birinci kart okundu");
}
Serial.println(our_id); //
our_id = "";
}
delay(300); // 3 saniye
}
Bu yukardaki ornekte software serial kullanmadim , rfid okuyucunun TX pin i Launchpad ustundeki UART RX (P1_1) e bagli