PDKS

Tüm saatler GMT +3 Saat


Full versiyon Görüntüle

YAZAR: slow1284
Tarih: 22/6/2018, 08:21



C# PDKS CİHAZI BAĞLAMA KODLARI


#include <cihan_mustafa_yoklama_sistemi.h>
#include <SoftwareSerial.h>

uint8_t id;

uint8_t getFingerprintEnroll();
SoftwareSerial mySerial(2, 3);
cihan_mustafa_yoklama_sistemi finger = cihan_mustafa_yoklama_sistemi(&mySerial);
void setup()
{
while (!Serial);
delay(500);

Serial.begin(9600);
Serial.println("Parmak Izi sensoru Baslatiliyor.");
finger.begin(57600);

if (finger.verifyPassword()) {
Serial.println("Parmak Izi Sensoru Bulundu!");
} else {
Serial.println("Parmak Izi Sensoru Bulunamadi Sad");
while (1);
}
}

uint8_t readnumber(void) {
uint8_t num = 0;
boolean validnum = false;
while (1) {
while (! Serial.available());
char c = Serial.read();
if (isdigit(c)) {
num *= 10;
num += c - '0';
validnum = true;
} else if (validnum) {
return num;
}
}
}

void loop()
{
Serial.println("Parmak Izi Sensoru Hazir. Lutfen ID numarasini giriniz.");
id = readnumber();
Serial.print("Kaydedilen ID #");
Serial.println(id);

while (! getFingerprintEnroll() );
}

uint8_t getFingerprintEnroll() {

int p = -1;
Serial.print("Parmak Izi Bekleniyor #"); Serial.println(id);
while (p != FINGERPRINT_OK) {
p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:
Serial.println("");
break;
case FINGERPRINT_NOFINGER:
Serial.println(".");
break;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("Iletisim Hatasi");
break;
case FINGERPRINT_IMAGEFAIL:
Serial.println("");
break;
default:
Serial.println("HATA");
break;
}
}



p = finger.image2Tz(1);
switch (p) {
case FINGERPRINT_OK:
Serial.println("");
break;
case FINGERPRINT_IMAGEMESS:
Serial.println("");
return p;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("Iletisim hatasi");
return p;
case FINGERPRINT_FEATUREFAIL:
Serial.println("Parmak izi ozelliklerini bulamadi");
return p;
case FINGERPRINT_INVALIDIMAGE:
Serial.println("Parmak izi ozelliklerini bulamadi");
return p;
default:
Serial.println("HATA");
return p;
}

Serial.println("Parmagi Kaldir");
delay(2000);
p = 0;
while (p != FINGERPRINT_NOFINGER) {
p = finger.getImage();
}
Serial.print("ID "); Serial.println(id);
p = -1;
Serial.println("Yine ayni parmagi yerlestirin");
while (p != FINGERPRINT_OK) {
p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:
Serial.println("");
break;
case FINGERPRINT_NOFINGER:
Serial.print(".");
break;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("İletisim hatasi");
break;
case FINGERPRINT_IMAGEFAIL:
Serial.println("");
break;
default:
Serial.println("HATA");
break;
}
}



p = finger.image2Tz(2);
switch (p) {
case FINGERPRINT_OK:
Serial.println("");
break;
case FINGERPRINT_IMAGEMESS:
Serial.println("");
return p;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("Iletisim Hatasi");
return p;
case FINGERPRINT_FEATUREFAIL:
Serial.println("Parmak izi Ozelliklerini bulamadi");
return p;
case FINGERPRINT_INVALIDIMAGE:
Serial.println("Parmak izi Ozelliklerini bulamadi");
return p;
default:
Serial.println("HATA");
return p;
}

Serial.print("Model Olusturuluyor #"); Serial.println(id);

p = finger.createModel();
if (p == FINGERPRINT_OK) {
Serial.println("Parmak Eslesti!");
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
Serial.println("Iletisim Hatasi");
return p;
}
else if (p == FINGERPRINT_ENROLLMISMATCH) {
Serial.println("Parmak izleri eslesmedi");
return p;
} else {
Serial.println("HATA");
return p;
}
Serial.print("ID "); Serial.println(id);
p = finger.storeModel(id);
if (p == FINGERPRINT_OK) {
Serial.println("Hafizaya alindi!");
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
Serial.println("Iletisim Hatasi");
return p;
} else if (p == FINGERPRINT_BADLOCATION) {
Serial.println("Burada Saklanamaz");
return p;
} else if (p == FINGERPRINT_FLASHERR) {
Serial.println("Hafiza yazma Hatasi");
return p;
} else {
Serial.println("HATA");
return p;
}
}
PARMAK İZİ SİSTEMİ GÖSTER KODLARI
#include <cihan_mustafa_yoklama_sistemi.h>
#include <SoftwareSerial.h>

int getFingerprintIDez();
SoftwareSerial mySerial(2, 3);

cihan_mustafa_yoklama_sistemi finger = cihan_mustafa_yoklama_sistemi(&mySerial);

void setup()
{
while(!Serial);
Serial.begin(9600);
Serial.println("Parmak izi sablonu test ediliyor.");

finger.begin(57600);

if (finger.verifyPassword()) {
Serial.println("Parmak izi sensoru bulundu.");
} else {
Serial.println("Parmak izi sensoru bulunamadi Sad");
while (1);
}

for (int finger = 1; finger < 10; finger++)
uploadFingerpintTemplate(finger);

}

void loop()
{
}

uint8_t uploadFingerpintTemplate(uint16_t id)
{
uint8_t p = finger.loadModel(id);
switch (p) {
case FINGERPRINT_OK:
Serial.print("Sablon "); Serial.print(id); Serial.println(" Yukleniyor.");
break;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("iletisim Hatasi");
return p;
default:
Serial.print("HATA "); Serial.println(p);
return p;
}
p = finger.getModel();
switch (p) {
case FINGERPRINT_OK:
Serial.print("Sablon "); Serial.print(id); Serial.println(" Transfer Ediliyor.");
break;
default:
Serial.print("HATA"); Serial.println(p);
return p;
}
uint8_t templateBuffer[256];
memset(templateBuffer, 0xff, 256);
int index=0;
uint32_t starttime = millis();
while ((index < 256) && ((millis() - starttime) < 1000))
{
if (mySerial.available())
{
templateBuffer[index] = mySerial.read();
index++;
}
}
Serial.print(index); Serial.println(" Okunan Bayt");

for (int count= 0; count < 16; count++)
{
for (int i = 0; i < 16; i++)
{
Serial.print("0x");
Serial.print(templateBuffer[count*16+i], HEX);
Serial.print(", ");
}
Serial.println();
}
}



-> Hazır kodlar/Programlar(C/C++/C#) -> PDA Görünüm - Ana Sayfa
Tüm saatler GMT +3 Saat


Full versiyon Görüntüle



Phpbb PDA Görünüm
Muhendisiz.net Tarafindan Yazilmistir.
Writed by muhendisiz.net © 2004 - 2007 All rights reserved.