Koddakı baglantıları çözemedım
  • #include < LiquidCrystal.h>
    #include < Adafruit_Fingerprint.h>
    #if ARDUINO >= 100
    #include < SoftwareSerial.h>
    #else
    #include < NewSoftSerial.h>
    #endif

    int getFingerprintIDez();

    // pin #2 is IN from sensor (GREEN wire)
    // pin #3 is OUT from arduino (WHITE wire)

    SoftwareSerial mySerial(2, 3);

    LiquidCrystal lcd(5, 6, 7, 8, 9, 10); // initialize the library with the numbers of the interface pins

    int buttonState = 0;

    Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

    void setup()

    {
    Serial.begin(9600); // initialize the serial communications:
    lcd.begin(16,2);
    lcd.setCursor(0,0);
    lcd.print("Scan your finger");
    pinMode(13,OUTPUT);
    pinMode(12,OUTPUT);
    pinMode(11, OUTPUT);
    pinMode(A0, INPUT);
    pinMode(A1, INPUT);
    finger.begin(57600); // set the data rate for the sensor serial port
    }

    void loop() // run over and over again

    {
    buttonState = digitalRead(A1);
    uint8_t id = 0;
    if (buttonState == HIGH)
    {
    id++;
    getFingerprintEnroll(id);
    delay(100);
    digitalWrite (11,HIGH);
    }

    else{
    getFingerprintID();
    delay(100);
    digitalWrite (13,HIGH);
    }
    }

    uint8_t getFingerprintID()
    {
    uint8_t p = finger.getImage();

    switch (p)

    {

    case FINGERPRINT_OK:

    lcd.clear();
    lcd.print(" Image taken... ");

    delay(1000);
    break;

    case FINGERPRINT_NOFINGER:
    return p;

    case FINGERPRINT_PACKETRECIEVEERR:
    return p;

    case FINGERPRINT_IMAGEFAIL:
    return p;

    default:
    return p;
    }

    // OK success!

    p = finger.image2Tz();

    switch (p) {

    case FINGERPRINT_OK:
    break;

    case FINGERPRINT_IMAGEMESS:
    return p;

    case FINGERPRINT_PACKETRECIEVEERR:
    return p;

    case FINGERPRINT_FEATUREFAIL:
    return p;

    case FINGERPRINT_INVALIDIMAGE:
    return p;

    default:
    return p;
    }

    // OK converted!

    p = finger.fingerFastSearch();
    if (p == FINGERPRINT_OK)

    {

    lcd.clear();
    lcd.print(" Found match! ");
    digitalWrite(11, HIGH);
    delay(1000);
    digitalWrite(11,LOW); // turn on green LED to indicate match

    }

    else if(p == FINGERPRINT_NOTFOUND)

    {

    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print(" Did not match! ");
    delay(1000);
    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print(" scan finger! ");
    return p;

    }

    else

    {
    return p;
    }

    // IF FOUND A MATCH............

    lcd.clear();
    lcd.setCursor(0,0);
    lcd.print("Found ID #");
    lcd.print(finger.fingerID);
    lcd.setCursor(0,1);
    lcd.print("confidence ");
    lcd.print(finger.confidence);
    }

    // returns -1 if failed, otherwise returns ID #

    int getFingerprintIDez() {
    uint8_t p = finger.getImage();

    if (p != FINGERPRINT_OK) return -1;
    p = finger.image2Tz();
    if (p != FINGERPRINT_OK) return -1;
    p = finger.fingerFastSearch();
    if (p != FINGERPRINT_OK) return -1;

    // found a match!

    digitalWrite(13, LOW);
    delay(10);
    digitalWrite(13, HIGH);
    delay(10);

    lcd.clear();
    lcd.setCursor(0, 0);
    lcd.print("Found ID # ");
    lcd.print(finger.fingerID);
    lcd.setCursor(0, 1);
    lcd.print("confidence ");
    lcd.print(finger.confidence);
    return finger.fingerID;

    }

    uint8_t getFingerprintEnroll(uint8_t id) {
    uint8_t p = -1;
    lcd.clear();
    lcd.print("Scan for Enroll");
    while (p != FINGERPRINT_OK) {
    p = finger.getImage();

    switch (p) {

    case FINGERPRINT_OK:
    lcd.clear();
    lcd.print(" Image taken... ");

    delay(1000);
    break;

    case FINGERPRINT_NOFINGER:
    return p;
    case FINGERPRINT_PACKETRECIEVEERR:
    return p;
    case FINGERPRINT_IMAGEFAIL:
    return p;
    default:
    return p;
    }
    }

    // OK success!

    p = finger.image2Tz(1);
    switch (p) {
    case FINGERPRINT_OK:
    break;
    case FINGERPRINT_IMAGEMESS:
    return p;
    case FINGERPRINT_PACKETRECIEVEERR:
    return p;
    case FINGERPRINT_FEATUREFAIL:
    return p;
    case FINGERPRINT_INVALIDIMAGE:
    return p;
    default:
    return p;
    }

    lcd.clear();
    lcd.print("Remove finger ");
    delay(2000);


    p = 0;
    while (p != FINGERPRINT_NOFINGER) {
    p = finger.getImage();
    }

    p = -1;
    lcd.clear();
    lcd.print("Rescan finger");

    while (p != FINGERPRINT_OK) {
    p = finger.getImage();
    switch (p) {
    case FINGERPRINT_OK:

    lcd.clear();
    lcd.print(" Image taken... ");

    delay(1000);
    break;

    case FINGERPRINT_NOFINGER:
    return p;

    case FINGERPRINT_PACKETRECIEVEERR:
    return p;

    case FINGERPRINT_IMAGEFAIL:
    return p;

    default:
    return p;
    }
    }

    // OK success!

    p = finger.image2Tz(2);
    switch (p) {
    case FINGERPRINT_OK:
    break;

    case FINGERPRINT_IMAGEMESS:
    return p;

    case FINGERPRINT_PACKETRECIEVEERR:
    return p;

    case FINGERPRINT_FEATUREFAIL:
    return p;

    case FINGERPRINT_INVALIDIMAGE:
    return p;

    default:
    return p;
    }


    // OK converted!
    p = finger.createModel();
    if (p == FINGERPRINT_OK) {
    lcd.clear();
    lcd.print("Prints matched!");
    }
    else if (p == FINGERPRINT_PACKETRECIEVEERR) {
    return p;
    }
    else if (p == FINGERPRINT_ENROLLMISMATCH) {
    return p;
    }
    else {
    return p;
    }

    p = finger.storeModel(id);
    if (p == FINGERPRINT_OK) {
    lcd.clear();
    lcd.print("Stored!");
    }
    else if (p == FINGERPRINT_PACKETRECIEVEERR) {
    return p;
    }
    else if (p == FINGERPRINT_BADLOCATION) {
    return p;
    }
    else if (p == FINGERPRINT_FLASHERR) {
    return p;
    }
    else {
    return p;
    }

    }



    Böyle bi kod buldumda , lcd olarak ne kullanabılırım ve baglantısını nasıl yapıacagım , birde buton baglantıları nasıl olucak yardımcı olurmusunuz?
  • kodu buldugunuz yerde tum detaylar olması lazım. setup kısmında kullanılan pinler tanımlanmış o pinlerı kullanmanız lazım.
    once kullanacagınız lcd yi tek çalıştırın standart kodlar ıle.
    daha sonra ayrıca parmak ızı okuyucuyu test edın en son bırleştırın.
    ben bu kod yazmadan anlamıyorum kopya yapıştırla yapırum dıyorsanız işiniz zor biraz temel şeylerı kendınız çözmenız lazım.
  • Tamamdır halletım hocam

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook
Açık kaynak kültürü gereği, çözdüğünüz problemlerin çözümlerini paylaşmayı lütfen unutmayın.