Tunahan Fıtlamak
Published

Control your devices with your fingerprint

A project that can control your devices with your fingerprint. Enriched menu with features such as recording and deleting your fingerprint I

IntermediateFull instructions provided3 hours220
Control your devices with your fingerprint

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×1
FPM10A parmak izi okuyucu
×1
128x128 1.5 Inch OLED Grafik Ekran - SPI/I2C - WaveShare
×1
5V 2 Kanal Röle Kartı (Geliştirme Kartlarıyla Uyumlu)
×1
6x6 20mm Tach Buton (4 Bacak)
×3
Jumper wires (generic)
Jumper wires (generic)
×1
Resistor 10k ohm
Resistor 10k ohm
×3

Software apps and online services

Circuit Maker
CircuitMaker by Altium Circuit Maker
Arduino IDE
Arduino IDE

Story

Read more

Schematics

Proje şeması

Code

Arduino kodu

C/C++
// On Leonardo/Micro or others with hardware serial, use those! #0 is green wire, #1 is white
// uncomment this line:
// #define mySerial Serial1

// For UNO and others without hardware serial, we must use software serial...
// pin #2 is IN from sensor (GREEN wire)
// pin #3 is OUT from arduino  (WHITE wire)
// comment these two lines if using hardware serial

#include <Adafruit_Fingerprint.h>
SoftwareSerial mySerial(2, 3);
#define EmptyAllFingerPrint 0
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

#include <U8g2lib.h>

#ifdef U8X8_HAVE_HW_SPI
#include <SPI.h>
#endif

U8G2_SSD1327_WS_128X128_1_4W_SW_SPI u8g2(U8G2_R0, /* clock=*/ 13, /* data=*/ 11, /* cs=*/ 10, /* dc=*/ 9, /* reset=*/ 8);

int x=0;
int bekleme;
int dogru=A0;
int yanlis=A1;

uint8_t id;
int arttir=5;
int ok=6;
int azalt=7;

byte num=0;
byte idkayit=0;//parmak izi kaydetme ve silme fonksiyonlarına girdiğini kontrol etme

const unsigned char parmakfoto[] U8X8_PROGMEM = { //ana ekrandaki fotoğraf bitmap çıktısı
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0xaa, 0xaa, 0x0d, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x60, 0x01, 0x00, 0xd0, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0xc0, 0x01, 0xfe, 0xd2, 0x0f, 0x70, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x0c, 0x1c, 0x80, 0x2a, 0x00, 0x0e, 0x04, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x20, 0x40, 0x00, 0x00, 0xa0, 0x80, 0x20, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x04, 0x02, 0x2a, 0x44, 0x05, 0x10, 0x04, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x50, 0x28, 0x80, 0x12, 0x00, 0x45, 0x11, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x81, 0xc0, 0x00, 0x00, 0xa0, 0x00, 0x20, 0x00, 0x00,
   0x00, 0x00, 0x60, 0x14, 0x02, 0x07, 0x00, 0x1e, 0x18, 0x86, 0x00, 0x00,
   0x00, 0x00, 0x00, 0xc2, 0x30, 0xa8, 0xea, 0x00, 0xc3, 0x10, 0x02, 0x00,
   0x00, 0x00, 0x80, 0x10, 0x06, 0x01, 0x00, 0x50, 0x08, 0x22, 0x00, 0x00,
   0x00, 0x00, 0x40, 0x84, 0x20, 0x58, 0x80, 0x06, 0x41, 0x84, 0x00, 0x00,
   0x00, 0x00, 0x10, 0x22, 0x84, 0x40, 0x5f, 0x20, 0x84, 0x10, 0x01, 0x00,
   0x00, 0x00, 0x80, 0x10, 0x02, 0x01, 0x00, 0x40, 0x10, 0x22, 0x02, 0x00,
   0x00, 0x00, 0x80, 0x88, 0x30, 0x04, 0x00, 0x05, 0x21, 0x22, 0x00, 0x00,
   0x00, 0x00, 0x40, 0x84, 0x08, 0xd1, 0x76, 0x20, 0x46, 0x84, 0x00, 0x00,
   0x00, 0x00, 0x20, 0x22, 0xc4, 0x08, 0x08, 0x46, 0x88, 0x88, 0x00, 0x00,
   0x00, 0x00, 0x20, 0x22, 0x22, 0xc4, 0xc1, 0x88, 0x88, 0x10, 0x00, 0x00,
   0x00, 0x00, 0x20, 0x22, 0x21, 0x32, 0x00, 0x11, 0x11, 0x11, 0x01, 0x00,
   0x00, 0x00, 0x10, 0x11, 0x11, 0x31, 0x00, 0x13, 0x11, 0x11, 0x01, 0x00,
   0x00, 0x00, 0x20, 0x10, 0x11, 0x11, 0x00, 0x13, 0x11, 0x10, 0x01, 0x00,
   0x00, 0x00, 0x10, 0x11, 0x11, 0x11, 0x00, 0x12, 0x11, 0x11, 0x01, 0x00,
   0x00, 0x00, 0x20, 0x11, 0x11, 0x30, 0x00, 0x13, 0x11, 0x18, 0x01, 0x00,
   0x00, 0x00, 0x10, 0x11, 0x11, 0x11, 0x00, 0x12, 0x11, 0x11, 0x01, 0x00,
   0x00, 0x00, 0x20, 0x22, 0x11, 0x32, 0x00, 0x23, 0x11, 0x11, 0x01, 0x00,
   0x00, 0x00, 0x20, 0x02, 0x31, 0x12, 0x00, 0x03, 0x23, 0x22, 0x02, 0x00,
   0x00, 0x00, 0x20, 0x22, 0x22, 0x32, 0x00, 0x22, 0x20, 0x22, 0x00, 0x00,
   0x00, 0x00, 0x20, 0x22, 0x42, 0x14, 0x00, 0x27, 0x46, 0x84, 0x00, 0x00,
   0x00, 0x00, 0x40, 0x24, 0x44, 0x1c, 0x00, 0x46, 0x88, 0x08, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x44, 0x44, 0x1c, 0x00, 0x87, 0x08, 0x21, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x88, 0x88, 0x18, 0x00, 0x13, 0x11, 0x02, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x80, 0x88, 0x10, 0x00, 0x23, 0x42, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x80, 0x3d, 0xb9, 0x1b, 0x00, 0x46, 0x08, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x20, 0x80, 0x07, 0x18, 0x00, 0x0b, 0x11, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x30, 0x80, 0x03, 0x18, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00,
   0x00, 0xf4, 0x1a, 0x00, 0x01, 0x10, 0x00, 0x23, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x03, 0x0c, 0x00, 0x01, 0x30, 0x00, 0x02, 0xe0, 0x03, 0x00, 0x00,
   0x00, 0x01, 0x18, 0x00, 0x01, 0x10, 0x00, 0x03, 0x0c, 0x30, 0x00, 0x00,
   0x80, 0x01, 0x18, 0x00, 0x01, 0x30, 0x00, 0x03, 0x06, 0xc0, 0x00, 0x00,
   0x00, 0x01, 0x18, 0x00, 0x01, 0x10, 0x00, 0x02, 0x01, 0x80, 0x00, 0x00,
   0x80, 0x00, 0x38, 0x80, 0x01, 0x30, 0x00, 0x83, 0x00, 0xc0, 0x00, 0x00,
   0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc2, 0x00, 0x60, 0x00, 0x00,
   0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x10, 0x00, 0x00,
   0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x33, 0x00, 0x18, 0x00, 0x00,
   0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x04, 0x00, 0x00,
   0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x06, 0x00, 0x00,
   0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x80, 0x01, 0x00, 0x00,
   0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
   0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
   0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00,
   0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
   0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
   0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
   0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
   0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x30, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0xe0, 0x02, 0x00, 0x40, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 
};

const unsigned char kapifoto[] U8X8_PROGMEM = {//doğru geçişteki fotoğraf bitmap çıktısı
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0,
   0x7f, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2f, 0xd0, 0xff, 0x7f, 0xff,
   0xff, 0x01, 0x00, 0xff, 0x0f, 0xc0, 0xff, 0xff, 0x7f, 0xff, 0xff, 0x01,
   0x00, 0x07, 0xf0, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xcf,
   0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xe7, 0xff, 0xff,
   0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef, 0xff, 0xff, 0xff, 0xff,
   0x7f, 0x00, 0xe0, 0x01, 0x00, 0xe7, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00,
   0xe0, 0x01, 0x00, 0xef, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01,
   0x00, 0xe7, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef,
   0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xe7, 0xff, 0xff,
   0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef, 0xff, 0xff, 0xff, 0xff,
   0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef, 0xff, 0xff, 0x7d, 0xff, 0x7f, 0x00,
   0xe0, 0x01, 0x00, 0xef, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01,
   0x00, 0xe7, 0xfb, 0xfe, 0xff, 0xf7, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef,
   0xff, 0xf7, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xe7, 0xff, 0xff,
   0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef, 0xff, 0xff, 0xff, 0xff,
   0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00,
   0xe0, 0x01, 0x00, 0xef, 0xff, 0xbf, 0xf7, 0xef, 0x7f, 0x00, 0xe0, 0x01,
   0x00, 0xe7, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef,
   0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef, 0xf7, 0xff,
   0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef, 0xff, 0xff, 0xbf, 0xff,
   0x7f, 0x00, 0xe0, 0x01, 0x00, 0xe7, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00,
   0xe0, 0x01, 0x00, 0xef, 0xff, 0xfe, 0xff, 0xdf, 0x7f, 0x00, 0xe0, 0x01,
   0x00, 0xe7, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef,
   0xff, 0x7f, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef, 0xff, 0xf7,
   0xff, 0x0f, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef, 0xfb, 0xff, 0xbf, 0x07,
   0x7f, 0x00, 0xe0, 0x01, 0x00, 0xe7, 0xff, 0xff, 0xff, 0x0f, 0x7f, 0x00,
   0xe0, 0x01, 0x00, 0xef, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01,
   0x00, 0xef, 0xff, 0xff, 0xfd, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef,
   0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xe7, 0xff, 0xff,
   0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef, 0xdf, 0xff, 0xff, 0xff,
   0x7f, 0x00, 0xe0, 0x01, 0x00, 0xe7, 0xff, 0xfb, 0xff, 0xff, 0x7f, 0x00,
   0xe0, 0x01, 0x00, 0xef, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01,
   0x00, 0xef, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef,
   0xff, 0xff, 0xbb, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xe7, 0xff, 0xff,
   0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef, 0xff, 0xef, 0xff, 0xf7,
   0x7f, 0x00, 0xe0, 0x01, 0x00, 0xe7, 0xfb, 0xff, 0xff, 0xff, 0x7f, 0x00,
   0xe0, 0x01, 0x00, 0xef, 0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01,
   0x00, 0xef, 0xbf, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef,
   0xff, 0xff, 0xff, 0xff, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xe7, 0xff, 0xff,
   0xff, 0xef, 0x7f, 0x00, 0xe0, 0x01, 0x00, 0xef, 0xff, 0xff, 0xde, 0xff,
   0x7f, 0x00, 0xe0, 0x01, 0x00, 0xe7, 0xff, 0xf7, 0xff, 0xff, 0x7f, 0x00,
   0xe0, 0x01, 0x00, 0x04, 0xf4, 0xff, 0xff, 0xff, 0x7f, 0x00, 0x40, 0x00,
   0x00, 0x00, 0x00, 0xf8, 0xff, 0xff, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x90, 0xef, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0xa0, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};

void setup()  
{
     u8g2.begin();//u8g2 başlatıyoruz
 
  while (!Serial);  // For Yun/Leo/Micro/Zero/...
  delay(100);

  // set the data rate for the sensor serial port
  finger.begin(57600);
  delay(5);
  if (finger.verifyPassword()) { //parmak izi sensörü bulunmuşsa onu gösteriyor
    u8g2.firstPage(); 
        do {
          u8g2.setFont(u8g2_font_ncenB10_tr);
          u8g2.drawFrame(4,1,120,16);//kod kafalar için kutu
          u8g2.setCursor(6, 15);
          u8g2.print("KOD KAFALAR");
          
          u8g2.setFont(u8g2_font_ncenB12_tr);
          u8g2.setCursor(5, 40);
          u8g2.print("PARMAK IZI");

          u8g2.setCursor(13, 55);
          u8g2.print("SENSORU");
          
          u8g2.setCursor(11, 70);
          u8g2.print("BULUNDU");
           
        } while ( u8g2.nextPage() );
    delay(3000);
  } else { //parmak izi sensörü bulunamadı onu gösteriyor
         u8g2.firstPage();
        do {
          u8g2.setFont(u8g2_font_ncenB10_tr);
          u8g2.drawFrame(4,1,120,16);//şarj göstergesi için kutu 
          u8g2.setCursor(6, 15);
          u8g2.print("KOD KAFALAR");
          
          u8g2.setFont(u8g2_font_ncenB12_tr);
          u8g2.setCursor(8, 40);
          u8g2.print("PARMAK IZI");

          u8g2.setCursor(19, 55);
          u8g2.print("SENSORU");
          u8g2.setFont(u8g2_font_ncenB10_tr);
          u8g2.setCursor(8, 70);
          u8g2.print("BULUNAMADI");
           
         } while ( u8g2.nextPage() );
    
    while (1) { delay(1); }
  }
  pinMode(arttir,INPUT);
  pinMode(ok,INPUT);
  pinMode(azalt,INPUT);
  
  pinMode(dogru,OUTPUT);
  pinMode(yanlis,OUTPUT);

  digitalWrite(dogru,HIGH);
  digitalWrite(yanlis,HIGH);

}

void loop()                     // run over and over again
{

       u8g2.firstPage();//parmağınızı okutunuz yazısı
        do {
          u8g2.setFont(u8g2_font_ncenB10_tr);
          u8g2.drawFrame(4,1,120,16);//şarj göstergesi için kutu 
          u8g2.setCursor(6, 15);
          u8g2.print("KOD KAFALAR");
          
          u8g2.setFont(u8g2_font_ncenB12_tr);
          u8g2.setCursor(0, 40);
          u8g2.print("PARMAGINIZI");

          u8g2.setCursor(9, 55);
          u8g2.print("OKUTUNUZ");

          u8g2.drawXBMP(20,57, 90, 70, parmakfoto);

        } while ( u8g2.nextPage() );

            getFingerprintIDez();//parmak okutma fonksiyonu
            delay(50);  

if (digitalRead(arttir)==HIGH) //arttır tuşuna uzun basarak parmak kaydetme için işlemler başlıyor
  {
    delay(750);
    if (digitalRead(arttir)==HIGH) 
   {
    //lcd.clear();
     while(true)
     {
        u8g2.firstPage();
        do {
          u8g2.setFont(u8g2_font_ncenB10_tr);
          u8g2.drawFrame(4,1,120,16);//şarj göstergesi için kutu 
          u8g2.setCursor(6, 15);
          u8g2.print("KOD KAFALAR");
          
          u8g2.setFont(u8g2_font_ncenB12_tr);
          u8g2.setCursor(36, 45);
          u8g2.print("KAYIT");

          u8g2.setCursor(16, 60);
          u8g2.print("EDILECEK");
          
          u8g2.setCursor(32, 85);
          u8g2.print("ID SEC");
          
          u8g2.setCursor(53, 105);
          u8g2.print(num);
          u8g2.setCursor(48, 108);
          u8g2.print("____");
           
         } while ( u8g2.nextPage() );
               
            if (digitalRead(arttir)==HIGH) //ıd seçim için arttır
            {
               num=num+1;
               delay(70);
               Serial.println(num);
               //lcd.clear();
            }
          
            if (digitalRead(azalt)==HIGH) //ıd seçim için azalt
            {
               num=num-1;
               delay(70);
               Serial.println(num);
               //lcd.clear();
            }
          
            if (digitalRead(ok)==HIGH) //okey tuşuna basarak seçilen num değişkenini id ye atıyoruz ve parmak kaydetme fonksiyonunu çağırıyoruz
            {
               id=num;
               Serial.println(num);
               //lcd.clear();
               Serial.print("Kayıt Kimliği#");
                Serial.println(id);
                u8g2.firstPage();
                do {
                  u8g2.setFont(u8g2_font_ncenB10_tr);
                  u8g2.drawFrame(4,1,120,16);//şarj göstergesi için kutu 
                  u8g2.setCursor(6, 15);
                  u8g2.print("KOD KAFALAR");
                  
                  u8g2.setFont(u8g2_font_ncenB12_tr);
                  u8g2.setCursor(35, 45);
                  u8g2.print("KAYIT");
        
                  u8g2.setCursor(25, 60);
                  u8g2.print("KIMLIGI");
        
                  u8g2.setCursor(53, 80);
                  u8g2.print(id);
                   
                } while ( u8g2.nextPage() );


              delay(3000);
               while(true)
               {
                getFingerprintEnroll();//parmak kaydetme fonksiyonu
                 if(idkayit==1)//döngüyü kırmak için
                 {
                   break;
                 }
               }
            }
             if(idkayit==1)
             {
               break;
             }
          }
       }  
     }
     
     if (digitalRead(azalt)==HIGH)//azalt tuşuna uzun basarak silme fonksiyonuna gidiyoruz 
    {
    delay(750);
    if (digitalRead(azalt)==HIGH) 
    {
    //lcd.clear();
     while(true)
     {
        u8g2.firstPage();
        do {
          u8g2.setFont(u8g2_font_ncenB10_tr);
          u8g2.drawFrame(4,1,120,16);//şarj göstergesi için kutu 
          u8g2.setCursor(6, 15);
          u8g2.print("KOD KAFALAR");
          
          u8g2.setFont(u8g2_font_ncenB12_tr);
          u8g2.setCursor(36, 45);
          u8g2.print("KAYIT");

          u8g2.setCursor(12, 60);
          u8g2.print("SILINECEK");
          
          u8g2.setCursor(32, 85);
          u8g2.print("ID SEC");
          
          u8g2.setCursor(53, 105);
          u8g2.print(num);
          u8g2.setCursor(48, 108);
          u8g2.print("____");          
         } while ( u8g2.nextPage() );
               
            if (digitalRead(arttir)==HIGH) //silinecek ıd için arttır 
            {
               num=num+1;
               delay(70);
               Serial.println(num);
               //lcd.clear();
            }
          
            if (digitalRead(azalt)==HIGH)//silinecek ıd için azalt 
            {
               num=num-1;
               delay(70);
               Serial.println(num);
               //lcd.clear();
            }       
            if (digitalRead(ok)==HIGH) //okey tuşuna basarak num değişkenini ıd ye atıyoruz ve silme fonksiyununu çağırıyoruz
            {
               id=num;
               Serial.println(num);
               //lcd.clear();
               Serial.print("Kayıt Kimliği#");
                Serial.println(id);
                u8g2.firstPage();
                do {
                  u8g2.setFont(u8g2_font_ncenB10_tr);
                  u8g2.drawFrame(4,1,120,16);//şarj göstergesi için kutu 
                  u8g2.setCursor(6, 15);
                  u8g2.print("KOD KAFALAR");
                  
                  u8g2.setFont(u8g2_font_ncenB12_tr);
                  u8g2.setCursor(10, 45);
                  u8g2.print("SILINECEK");
        
                  u8g2.setCursor(30, 60);
                  u8g2.print("KIMLIK");
        
                  u8g2.setCursor(53, 80);
                  u8g2.print(id);
                   
                } while ( u8g2.nextPage() );
              delay(3000);
               while(true)
               {
                deleteFingerprint(id);//silme fonksiyonunu çağırıyoruz
                 if(idkayit==1)//döngüyü kırmak için
                 {
                   break;
                 }
               }
             }
             if(idkayit==1)
             {
               break;
             }
          }
       }  
     }
     
      idkayit=0;
      
  }
uint8_t deleteFingerprint(uint8_t id) {//silme fonksiyonu
  uint8_t p = -1;
  
  p = finger.deleteModel(id);

  if (p == FINGERPRINT_OK) {//silme işlemi başarılı ise
        u8g2.firstPage();
        do {
          u8g2.setFont(u8g2_font_ncenB10_tr);
          u8g2.drawFrame(4,1,120,16);//şarj göstergesi için kutu 
          u8g2.setCursor(6, 15);
          u8g2.print("KOD KAFALAR");
          
          u8g2.setFont(u8g2_font_ncenB12_tr);
          u8g2.setCursor(0, 45);
          u8g2.print("SILME ISLEMI");

          u8g2.setCursor(20, 60);
          u8g2.print("BASARLI");

          u8g2.setCursor(53, 80);
          u8g2.print(id);
          
          u8g2.setCursor(18, 95);
          u8g2.print("ID SILINDI");
          
        } while ( u8g2.nextPage() );

         delay(2500);
  } else if (p == FINGERPRINT_PACKETRECIEVEERR) {//silme işleminde bir hata oldu ise
    bilinmeyenhata();
    return p;
  } else if (p == FINGERPRINT_BADLOCATION) {//silme işleminde bir hata oldu ise
    bilinmeyenhata();
    return p;
  } else if (p == FINGERPRINT_FLASHERR) {//silme işleminde bir hata oldu ise
    bilinmeyenhata();
    return p;
  } else {//silme işleminde bir hata oldu ise
    bilinmeyenhata();
    return p;
  }  

   idkayit=1;
}
void iddogru()//parmak okuttuğumuzda doğru parmak ise
{
    digitalWrite(dogru,LOW);
        u8g2.firstPage();
        do {
          u8g2.setFont(u8g2_font_ncenB10_tr);
          u8g2.drawFrame(4,1,120,16);//şarj göstergesi için kutu 
          u8g2.setCursor(6, 15);
          u8g2.print("KOD KAFALAR");
          
          u8g2.setFont(u8g2_font_ncenB12_tr);
          u8g2.setCursor(8, 35);
          u8g2.print("PARMAK IZI");

          u8g2.setCursor(26, 50);
          u8g2.print("DOGRU");
          u8g2.setFont(u8g2_font_ncenB10_tr);
          u8g2.setCursor(5, 65);
          u8g2.print("GECEBILIRSIN");

          u8g2.drawXBMP(20,66, 80, 60, kapifoto);
           
        } while ( u8g2.nextPage() ); 
  delay(2000);
  digitalWrite(dogru,HIGH);
}
void idyanlis()//parmak okuttuğumuzda tanımlı parmak değil ise
{
  digitalWrite(yanlis,LOW);
        u8g2.firstPage();
        do {
          u8g2.setFont(u8g2_font_ncenB10_tr);
          u8g2.drawFrame(4,1,120,16);//şarj göstergesi için kutu 
          u8g2.setCursor(6, 15);
          u8g2.print("KOD KAFALAR");
          
          u8g2.setFont(u8g2_font_ncenB12_tr);
          u8g2.setCursor(4, 40);
          u8g2.print("PARMAK IZI");

          u8g2.setCursor(19, 55);
          u8g2.print("GECERLI");
          
          u8g2.setCursor(28, 70);
          u8g2.print("DEGIL");
           
        } while ( u8g2.nextPage() );
   delay(2000);
   digitalWrite(yanlis,HIGH);
}

void getFingerprintIDez()//parmak okuma fonksiyonu
{
  uint8_t p = finger.getImage();//resim çildimi kontrol ediyor
  if (p != FINGERPRINT_OK){  return -1;}

     p = finger.image2Tz();
    switch (p) {
      case FINGERPRINT_OK://parmak geçerli ise   
        break;
      case FINGERPRINT_IMAGEMESS://okuma işleminde bir hata oldu 
      idyanlis();
        return p;
      case FINGERPRINT_PACKETRECIEVEERR://okuma işleminde bir hata oldu 
      idyanlis();
        return p;
      case FINGERPRINT_FEATUREFAIL://okuma işleminde bir hata oldu 
      idyanlis();
        return p;
      case FINGERPRINT_INVALIDIMAGE://okuma işleminde bir hata oldu 
      idyanlis();
        return p;
      default://okuma işleminde bir hata oldu 
        idyanlis();
        return p;
    }

    p = finger.fingerFastSearch();
    if (p == FINGERPRINT_OK) {//parmak izi tespit edildi
    } else if (p == FINGERPRINT_PACKETRECIEVEERR) {//okuma işleminde bir hata oldu 
      idyanlis();
      return p;
    } else if (p == FINGERPRINT_NOTFOUND) {//okuma işleminde bir hata oldu 
      idyanlis();
      return p;
    } else {//okuma işleminde bir hata oldu 
      idyanlis();
      return p;
    }  
   if(finger.fingerID<200&&0<=finger.fingerID)//okunan id 0 ile 200 arasında ise iddogru fonksiyonunu çağır
   {
     iddogru();
     delay(100);
   }
  return finger.fingerID; 
}

void bilinmeyenhata()//biinmeyen hata göstgerge fonsiyonu
{
   u8g2.firstPage();
        do {
          u8g2.setFont(u8g2_font_ncenB10_tr);
          u8g2.setCursor(6, 15);
          u8g2.print("KOD KAFALAR");
          
          u8g2.setFont(u8g2_font_ncenB12_tr);
          u8g2.setCursor(5, 40);
          u8g2.print("BILINMEYEN");

          u8g2.setCursor(20, 55);
          u8g2.print("HATA");
          
          u8g2.setCursor(12, 70);
          u8g2.print("TEKRAR");

          u8g2.setCursor(4, 85);
          u8g2.print("DENEYINIZ");
           
        } while ( u8g2.nextPage() );
        delay(2500);
}
void getFingerprintEnroll() {//parmak kaydetme fonksiyonu
  int p = -1;
       u8g2.firstPage();
        do {
          u8g2.setFont(u8g2_font_ncenB10_tr);
          u8g2.drawFrame(4,1,120,16);//şarj göstergesi için kutu 
          u8g2.setCursor(6, 15);
          u8g2.print("KOD KAFALAR");
          
          u8g2.setFont(u8g2_font_ncenB12_tr);
          u8g2.setCursor(19, 40);
          u8g2.print("GECERLI");

          u8g2.setCursor(18, 55);
          u8g2.print("PARMAGI");
          
          u8g2.setCursor(0, 70);
          u8g2.print("KAYDET..........");
          
          u8g2.setFont(u8g2_font_ncenB10_tr);
          u8g2.setCursor(8, 90);
          u8g2.print("PARMAGINIZI");
          u8g2.setCursor(16, 105);
          u8g2.print("OKUTUNUZ");
           
        } while ( u8g2.nextPage() );   
  while (p != FINGERPRINT_OK) {
    p = finger.getImage();
    switch (p) {
    case FINGERPRINT_OK:   //parmak okutuldu diğerişleme geç
      break;
    case FINGERPRINT_NOFINGER://parmak bekleniyor
      break;
    case FINGERPRINT_PACKETRECIEVEERR://bilinmeyen hata
    bilinmeyenhata();
      break;
    case FINGERPRINT_IMAGEFAIL://bilinmeyen hata
    bilinmeyenhata();
      break;
    default://bilinmeyen hata
    bilinmeyenhata();
      break;
    }
  }
  // OK success!
  p = finger.image2Tz(1);
  switch (p) {
    case FINGERPRINT_OK: //parmak okutuldu diğerişleme geç
      break;
    case FINGERPRINT_IMAGEMESS://parmak bekleniyor
    bilinmeyenhata();
      return p;
    case FINGERPRINT_PACKETRECIEVEERR://bilinmeyen hata
    bilinmeyenhata();
      return p;
    case FINGERPRINT_FEATUREFAIL://bilinmeyen hata
    bilinmeyenhata();
      return p;
    case FINGERPRINT_INVALIDIMAGE://bilinmeyen hata
    bilinmeyenhata();
      return p;
    default://bilinmeyen hata
    bilinmeyenhata();
      return p;
  }
        for(int i=0;i<130;i=i+5)//parmağınızı kaldırmanızı gösteren fonksiyon
          {
            u8g2.firstPage();
           do {
            u8g2.setFont(u8g2_font_ncenB10_tr);
            u8g2.drawFrame(4,1,120,16);//şarj göstergesi için kutu 
          u8g2.setCursor(6, 15);
          u8g2.print("KOD KAFALAR");
          
          u8g2.setFont(u8g2_font_ncenB12_tr);
          u8g2.setCursor(8, 40);
          u8g2.print("PARMAGINI");

          u8g2.setCursor(25, 55);
          u8g2.print("KALDIR");
          
          u8g2.setCursor(i, 70);
          u8g2.print(".");
          delay(5);
          } while ( u8g2.nextPage() );
          } 
  delay(1000);
  p = 0;
  while (p != FINGERPRINT_NOFINGER) {
    p = finger.getImage();
  }
  p = -1;
       u8g2.firstPage();
        do {
          u8g2.setFont(u8g2_font_ncenB10_tr);
          u8g2.drawFrame(4,1,120,16);//şarj göstergesi için kutu 
          u8g2.setCursor(6, 15);
          u8g2.print("KOD KAFALAR");
          
          u8g2.setCursor(3, 40);
          u8g2.print("AYNI PARMAGI");
          
          u8g2.setFont(u8g2_font_ncenB12_tr);
          u8g2.setCursor(22, 55);
          u8g2.print("TEKRAR");
          
          u8g2.setCursor(8, 70);
          u8g2.print("OKUTUNUZ");
           
        } while ( u8g2.nextPage() );
    delay(3000);
  while (p != FINGERPRINT_OK) {
    p = finger.getImage();
    switch (p) {
    case FINGERPRINT_OK: //parmak okutuldu diğerişleme geç
      break;
    case FINGERPRINT_NOFINGER://parmak bekleniyor
      break;
    case FINGERPRINT_PACKETRECIEVEERR://bilinmeyen hata
    bilinmeyenhata();
      break;
    case FINGERPRINT_IMAGEFAIL://bilinmeyen hata
     bilinmeyenhata();
      break;
    default://bilinmeyen hata
     bilinmeyenhata();
      break;
    }
  }
  // OK success!
  p = finger.image2Tz(2);
  switch (p) {
    case FINGERPRINT_OK: //parmak okutuldu diğerişleme geç
      break;
    case FINGERPRINT_IMAGEMESS://bilinmeyen hata
     bilinmeyenhata();
      return p;
    case FINGERPRINT_PACKETRECIEVEERR://bilinmeyen hata
     bilinmeyenhata();
      return p;
    case FINGERPRINT_FEATUREFAIL://bilinmeyen hata
     bilinmeyenhata();
      return p;
    case FINGERPRINT_INVALIDIMAGE://bilinmeyen hata
     bilinmeyenhata();
      return p;
    default://bilinmeyen hata
      bilinmeyenhata();
      return p;
  }
        u8g2.firstPage();
        do {
          u8g2.setFont(u8g2_font_ncenB10_tr);
          u8g2.drawFrame(4,1,120,16);//şarj göstergesi için kutu 
          u8g2.setCursor(6, 15);
          u8g2.print("KOD KAFALAR");
          
          u8g2.setFont(u8g2_font_ncenB12_tr);
          u8g2.setCursor(12, 40);
          u8g2.print(id);

          u8g2.setCursor(40, 40);
          u8g2.print("ID ICIN");
          
          u8g2.setCursor(28, 55);
          u8g2.print("MODEL");
          
          u8g2.setCursor(23, 70);
          u8g2.print("OLUSTU");
          
          u8g2.setFont(u8g2_font_ncenB12_tr);
          u8g2.setCursor(0, 80);
          u8g2.print("............................."); 
        } while ( u8g2.nextPage() );
  
    delay(3000);
  // OK converted!
  p = finger.createModel();
  if (p == FINGERPRINT_OK) {
        u8g2.firstPage();
        do {
          u8g2.setFont(u8g2_font_ncenB10_tr);
          u8g2.drawFrame(4,1,120,16);//şarj göstergesi için kutu 
          u8g2.setCursor(6, 15);
          u8g2.print("KOD KAFALAR");
          
          u8g2.setFont(u8g2_font_ncenB12_tr);
          u8g2.setCursor(18, 40);
          u8g2.print("BASKILAR");

          u8g2.setCursor(26, 55);
          u8g2.print("ESLESTI");  
        } while ( u8g2.nextPage() );
  
    delay(2500);

  } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
     bilinmeyenhata();
    return p;
  } else if (p == FINGERPRINT_ENROLLMISMATCH) {
     bilinmeyenhata();
    return p;
  } else {
     bilinmeyenhata();
    return p;
  }   

  p = finger.storeModel(id);//id ye parmak izini tanımla
  if (p == FINGERPRINT_OK) 
  {

  } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
     bilinmeyenhata();
    return p;
  } else if (p == FINGERPRINT_BADLOCATION) {
     bilinmeyenhata();
    return p;
  } else if (p == FINGERPRINT_FLASHERR) {
     bilinmeyenhata();
    return p;
  } else {
     bilinmeyenhata();
    return p;
  }   

      for(int i=0;i<130;i=i+5)
          {
            u8g2.firstPage();
           do {
          u8g2.setFont(u8g2_font_ncenB10_tr);
          u8g2.drawFrame(4,1,120,16);//şarj göstergesi için kutu 
          u8g2.setCursor(6, 15);
          u8g2.print("KOD KAFALAR");
          
          u8g2.setFont(u8g2_font_ncenB12_tr);
          u8g2.setCursor(7, 40);
          u8g2.print("PARMAK IZI");

          u8g2.setCursor(3, 55);
          u8g2.print("KAYDEDILDI");
          
          u8g2.setCursor(i, 70);
          u8g2.print(".");
          delay(5);
          } while ( u8g2.nextPage() );
          }

    delay(1000);

  id=0;
  idkayit=1;
}

Credits

Tunahan Fıtlamak

Tunahan Fıtlamak

3 projects • 1 follower

Comments