Paso 4: Pieza de Software:
/ Proyecto de lector de tarjetas RFID voz Robimek 2015
Licencia de software por Robimek
#include < SPI.h >
#include < RFID.h >
#include < Wtv020sd16p.h >
int resetPin = 2;
clockPin int = 3;
dataPin int = 4;
int busyPin = 5;
Wtv020sd16p(resetPin,clockPin,dataPin,busyPin) de Wtv020sd16p;
Rfid(10,9) RFID; RFID sda ve reset pinleri
byte emaomos [5] = {19,168,166,2,31}; kartın kimlik numarası
serNum Byte [5];
datos del octeto [5];
int LED_access = 6; Yesil led
int LED_intruder = 7; Kırmızı led
void setup() {}
wtv020sd16p.Reset();
Serial.Begin(9600);
RFID.init();
pinMode(LED_access,OUTPUT);
pinMode(LED_intruder,OUTPUT);
}
void loop() {}
Boolean emaomos_card = true;
Si (rfid.isCard()) {/ / karttan verilerin okunması
Si (rfid.readCardSerial()) {}
Delay(1000);
datos [0] = rfid.serNum[0];
datos [1] = rfid.serNum[1];
datos [2] = rfid.serNum[2];
datos [3] = rfid.serNum[3];
datos [4] = rfid.serNum[4];
}
para (int i = 0; i < 5; i ++) {}
Si (datos [i]! = emaomos[i]) emaomos_card = false;
}
Si (emaomos_card) {/ / kartın verileri eşleşiyor ise
wtv020sd16p.playVoice(2);
Delay(4000);
digitalWrite(LED_access,HIGH);
Delay(2000); digitalWrite(LED_access,LOW);
}
Else {/ / kimlik Español eşleşmiyor ise
wtv020sd16p.playVoice(1);
Delay(4000);
digitalWrite (LED_intruder, alto);
Delay(2000);
digitalWrite (LED_intruder, bajo);
}
Delay(500);
RFID.HALT();
}
}
Más información: http://www.robimek.com/rfid-sesli-kart-okuyucu-projesi/