Problem Finger Print with Ultrasonic and DHT22

Hi! Can you please help me with my code. Actually, i have college project, the idea are use finger print,ultrasonic and temperature sensor. i use 2 program separetely and it’s working but when i’m join that program that’s not working.

First Code :

#include <Adafruit_Fingerprint.h>
#include <SoftwareSerial.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>

LiquidCrystal_I2C lcd(0x27,16,2);
int getFingerprintIDez();
SoftwareSerial mySerial(2, 3);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);
char kode,i;

void setup()  
{
   
   pinMode(4,OUTPUT);   
   kode=20;
   lcd.begin();
   lcd.print("My Project");
   lcd.setCursor(0,1);
   lcd.print("Finger print");  
   finger.begin(57600);
 
}

void loop()                     
{
  lcd.clear();
  lcd.print("Place your");
  lcd.setCursor(0,1);
  lcd.print("Finger");
  i=1;
  while(i){
  getFingerprintIDez();
  delay(1000);            
  }
}

uint8_t getFingerprintID() {
  uint8_t p = finger.getImage();
  switch (p) {
    case FINGERPRINT_OK:
      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) {
    
  } else if (p == FINGERPRINT_PACKETRECIEVEERR) {
    return p;
  } else if (p == FINGERPRINT_NOTFOUND) {
    return p;
  } else {
    return p;
  }   
  
  }

// 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!
  i=0;
  if(finger.fingerID==kode){     
      lcd.clear();
      lcd.print("Your Finger");
      lcd.setCursor(0,1);      
      lcd.print("is OK");
      digitalWrite(4,HIGH);      
      delay(2000);              
      }
   else{
      lcd.clear();
      lcd.print("Your Finger");
      lcd.setCursor(0,1);      
      lcd.print("is wrong");
      digitalWrite(4,LOW);      
      delay(2000);
      
   }
  return finger.fingerID;   
}

and program for ultrasonic and dht

#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <SoftwareSerial.h>

#define ECHOPIN 9
#define TRIGPIN 8

#include "DHT.h"
#define DHTPIN 7
#define DHTTYPE DHT22

LiquidCrystal_I2C lcd(0x27, 16, 2); //Create Liquid Crystal Object called LCD
unsigned int distance, timer;

DHT dht(DHTPIN, DHTTYPE);
int h, t;

void setup() {
  Serial.begin(9600);
  lcd.begin(); //Tell Arduino to start your 16x2 LCD
  lcd.setCursor(0, 1);
  lcd.print("         T=   C");
  dht.begin();

  pinMode(ECHOPIN, INPUT);
  pinMode(TRIGPIN, OUTPUT);
  pinMode(5, OUTPUT);
}
void loop() {

  t = dht.readTemperature();
  lcd.setCursor(12, 1);
  lcd.print(t);

  Serial.print(t);
  Serial.print('A');
  
  digitalWrite(TRIGPIN, LOW);
  delayMicroseconds(2);
  digitalWrite(TRIGPIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIGPIN, LOW);
  timer = pulseIn(ECHOPIN, HIGH);
  distance = timer / 58;

  if (distance > 25) {
    lcd.setCursor(0, 1);
    lcd.print(distance);
    lcd.print("  cm  ");
    digitalWrite(5, 1);
    delay(1000);
  }
  else {
    lcd.setCursor(0, 1);
    lcd.print(distance);
    lcd.print("  cm  ");
    digitalWrite(5, 0);
    delay(1000);
  }

}

Two code is working separetely, and i was try to join them but its not working. That new program that i want are :

  1. scan fingerprint and if OK, data from ultrasonic and dht appear on LCD with simultaneous or realtime or 1 second delay.
  2. scan fingerprint and if NOT OK, repeat menu until finger OK.

Please help me to understanding that

Thank You

Some code you didn't post does something. You expect that code to do something. What either of those things is is a complete mystery.

with simultaneous or realtime or 1 second delay.

Make up your mind.