Need help getting my code to run as it should with a fingerprint sensor.

Hello all im trying to create a security system that requires an rfid tag, a pin, and a finger scan to work. so far ive gotten the first two parts to work but im running into issues with the third part. When i try to
have the code switch to the fingerprint portion it compiles but the lcd flickers after scanning the rfid tag. Im not sure if its because of the codes logic or the program being to intense.Also i get errors when i try to add the function that starts to scan fingerprints i get an error. Any help would be greatly appreciated. (This may be the second time i posted this. If it is i apologize i couldnt find the first post)

#include <Adafruit_Fingerprint.h>

#include <LiquidCrystal.h> //include LCD library (standard library)
#include <Keypad.h> //include keypad library - first you must install library (library link in the video description)

#include <SPI.h>                    // This sketch uses the SPI.h library
#include <MFRC522.h>                // This sketch uses the MFRC522.h library

#define redLED 10 //define the LED pins
#define greenLED 11

#define SS_PIN 53
#define RST_PIN 13
MFRC522 mfrc522(SS_PIN, RST_PIN);   // Create MFRC522 instance.

char* pin = "7597"; //create a pin
char pinlength = 0; //keypad position
char pinenter[4]; // store entered pin
String keycardcode = "BB 9A 2B 1B"  ;//accepted key card uids
int j = 0;

boolean RfidMode = true;
boolean FingerMode = true;
int getFingerprintIDez();
SoftwareSerial mySerial(42, 43);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);


const byte rows = 4; //number of the keypad's rows and columns
const byte cols = 4;

char keyMap [rows] [cols] = { //define the cymbols on the buttons of the keypad

  {'1', '2', '3', 'A'},
  {'4', '5', '6', 'B'},
  {'7', '8', '9', 'C'},
  {'*', '0', '#', 'D'}
};

byte rowPins [rows] = {1, 2, 3, 4}; //pins of the keypad
byte colPins [cols] = {5, 6, 7, 8};

Keypad myKeypad = Keypad( makeKeymap(keyMap), rowPins, colPins, rows, cols);

LiquidCrystal lcd (A0, A1, A2, A3, A4, A5); // pins of the LCD. (RS, E, D4, D5, D6, D7)

void setup() {

  SPI.begin();      // Initiate  SPI bus
  mfrc522.PCD_Init();   // Initiate MFRC522
  lcd.begin(16, 2); // LCD SCREEN
  pinMode(redLED, OUTPUT);  //set the LED as an output
  pinMode(greenLED, OUTPUT);
  finger.begin(57600);


  

}

void loop () {


  
//--------------------------------------------------------------------------------------------------------
  if (RfidMode == true)
  {
    lcd.setCursor(0, 0);
    lcd.print(" Welcome ");
    lcd.setCursor(0, 1);
    lcd.print (" Scan Key Card" );

    // Look for new cards
    if ( ! mfrc522.PICC_IsNewCardPresent())
    {
      return;
    }
    // Select one of the cards
    if ( ! mfrc522.PICC_ReadCardSerial())
    {
      return;
    }

    // Rading the the key card
    String keycard = "";
    for (byte i = 0; i < mfrc522.uid.size; i++)
    {
      keycard.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
      keycard.concat(String(mfrc522.uid.uidByte[i], HEX));
    }
    keycard.toUpperCase();

    //Checking the key card
    if (keycard.substring(1) == keycardcode)
    {
      //If Key card is correct
      lcd.clear();
      lcd.print(" Key Card Accepted ");
      digitalWrite(greenLED, HIGH);
      delay(3000);
      digitalWrite(greenLED, LOW);

      lcd.clear();
      lcd.print(" Enter Pin ");
     
      RfidMode = false; // change rfid mode to false and get pin
    }

    else
    {
      //IF key card is wrong
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print(" Wrong Key card ");
      lcd.setCursor(0, 1);
      lcd.print(" Access Denied!!! ");
      digitalWrite(redLED, HIGH);
      delay(3000);
      digitalWrite(redLED, LOW);
      lcd.clear();
    }
  }
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  // When switch to enter Pin
  if (RfidMode == false ) {
    pinlength =  myKeypad.getKey();
    if (pinlength)
    {
      pinenter[j++] = pinlength;
      lcd.print("*");
    }
    if (j == 4) // waits for 4 keys to be input
    {
      delay (200);
      if (!(strncmp(pinenter, pin, 4))) //Checks if pin entered is a match
      {
        lcd.clear();
        lcd.print(" Pin Accepted ");
        digitalWrite(greenLED, HIGH);
        delay (3000);
        digitalWrite(greenLED, LOW);
        lcd.clear();
        
        j = 0;
        
      
  FingerMode= true ; // Make finger mode true 
      }
      else //if pin is wrong
      {
        lcd.clear();
        lcd.print(" Wrong Pin ");
        digitalWrite(redLED, HIGH);
        delay (3000);
        digitalWrite(redLED, LOW);
        lcd.clear();
        j = 0;
        RfidMode = true; // Make rfid mode true
      }
    }
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if ( FingerMode == true){
  
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print(" scan finger");
  
}


  }
}

lcd.clear() will cause you LCD display appear to flicker: you clear it, then you write something new. There is a short time in between where the display goes blank before the new data appears. You can prevent this by just overwriting whatever is on the display, padding your new message with whitespace to clear any remaining characters.

You forgot to post the error, so can't say much about that.

+Karma for using code tags.

You can see your posts by using this URL:
https://forum.arduino.cc/index.php?action=profile;area=showposts;sa=messages;u=123456
Change 123456 to your user number. to find your UserID, click on your name to open your profile and look in the URL for "u=123456" at the end. You can then make a shortcut to the page that opens.

In your code, are RfidMode and FingerMode supposed to be mutually exclusive? If so, that may be your problem- they aren't.

SteveMann:
+Karma for using code tags.

You can see your posts by using this URL:
https://forum.arduino.cc/index.php?action=profile;area=showposts;sa=messages;u=123456
Change 123456 to your user number. to find your UserID, click on your name to open your profile and look in the URL for "u=123456" at the end. You can then make a shortcut to the page that opens.

In your code, are RfidMode and FingerMode supposed to be mutually exclusive? If so, that may be your problem- they aren't.

Thank you. I believe that is what im trying to do. I created the finger mode to follow up the keypad entry.

wvmarle:
lcd.clear() will cause you LCD display appear to flicker: you clear it, then you write something new. There is a short time in between where the display goes blank before the new data appears. You can prevent this by just overwriting whatever is on the display, padding your new message with whitespace to clear any remaining characters.

You forgot to post the error, so can't say much about that.

I think i explained the lcd part wrong. it does flicker but instead of flickering and saying enter pin it says scan finger. As for the error i get this

Arduino: 1.8.9 (Windows Store 1.8.21.0) (Windows 10), Board: "Arduino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Users\steve\Documents\Arduino\finalpart9\finalpart9.ino:16:13: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

 char* pin = "7597"; //create a pin

             ^~~~~~

C:\Users\steve\AppData\Local\Temp\cczoWH8K.ltrans0.ltrans.o: In function `main':

<artificial>:(.text.startup+0xc72): undefined reference to `getFingerprintIDez()'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino Mega or Mega 2560.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

This happens when I use this funtion

 {
  getFingerprintIDez();
  delay(50);            //don't ned to run this at full speed.
}

And this is how it looks in the full code.

#include <Adafruit_Fingerprint.h>

#include <LiquidCrystal.h> //include LCD library (standard library)
#include <Keypad.h> //include keypad library - first you must install library (library link in the video description)

#include <SPI.h>                    // This sketch uses the SPI.h library
#include <MFRC522.h>                // This sketch uses the MFRC522.h library

#define redLED 10 //define the LED pins
#define greenLED 11

#define SS_PIN 53
#define RST_PIN 13
MFRC522 mfrc522(SS_PIN, RST_PIN);   // Create MFRC522 instance.

char* pin = "7597"; //create a pin
char pinlength = 0; //keypad position
char pinenter[4]; // store entered pin
String keycardcode = "BB 9A 2B 1B"  ;//accepted key card uids
int j = 0;

boolean RfidMode = true;
boolean FingerMode = true;
int getFingerprintIDez();
SoftwareSerial mySerial(42, 43);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);


const byte rows = 4; //number of the keypad's rows and columns
const byte cols = 4;

char keyMap [rows] [cols] = { //define the cymbols on the buttons of the keypad

  {'1', '2', '3', 'A'},
  {'4', '5', '6', 'B'},
  {'7', '8', '9', 'C'},
  {'*', '0', '#', 'D'}
};

byte rowPins [rows] = {1, 2, 3, 4}; //pins of the keypad
byte colPins [cols] = {5, 6, 7, 8};

Keypad myKeypad = Keypad( makeKeymap(keyMap), rowPins, colPins, rows, cols);

LiquidCrystal lcd (A0, A1, A2, A3, A4, A5); // pins of the LCD. (RS, E, D4, D5, D6, D7)

void setup() {

  SPI.begin();      // Initiate  SPI bus
  mfrc522.PCD_Init();   // Initiate MFRC522
  lcd.begin(16, 2); // LCD SCREEN
  pinMode(redLED, OUTPUT);  //set the LED as an output
  pinMode(greenLED, OUTPUT);
  finger.begin(57600);


  

}

void loop () {


  
//--------------------------------------------------------------------------------------------------------
  if (RfidMode == true)
  {
    lcd.setCursor(0, 0);
    lcd.print(" Welcome ");
    lcd.setCursor(0, 1);
    lcd.print (" Scan Key Card" );

    // Look for new cards
    if ( ! mfrc522.PICC_IsNewCardPresent())
    {
      return;
    }
    // Select one of the cards
    if ( ! mfrc522.PICC_ReadCardSerial())
    {
      return;
    }

    // Rading the the key card
    String keycard = "";
    for (byte i = 0; i < mfrc522.uid.size; i++)
    {
      keycard.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
      keycard.concat(String(mfrc522.uid.uidByte[i], HEX));
    }
    keycard.toUpperCase();

    //Checking the key card
    if (keycard.substring(1) == keycardcode)
    {
      //If Key card is correct
      lcd.clear();
      lcd.print(" Key Card Accepted ");
      digitalWrite(greenLED, HIGH);
      delay(3000);
      digitalWrite(greenLED, LOW);

      lcd.clear();
      lcd.print(" Enter Pin ");
     
      RfidMode = false; // change rfid mode to false and get pin
    }

    else
    {
      //IF key card is wrong
      lcd.clear();
      lcd.setCursor(0, 0);
      lcd.print(" Wrong Key card ");
      lcd.setCursor(0, 1);
      lcd.print(" Access Denied!!! ");
      digitalWrite(redLED, HIGH);
      delay(3000);
      digitalWrite(redLED, LOW);
      lcd.clear();
    }
  }
//-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  // When switch to enter Pin
  if (RfidMode == false ) {
    pinlength =  myKeypad.getKey();
    if (pinlength)
    {
      pinenter[j++] = pinlength;
      lcd.print("*");
    }
    if (j == 4) // waits for 4 keys to be input
    {
      delay (200);
      if (!(strncmp(pinenter, pin, 4))) //Checks if pin entered is a match
      {
        lcd.clear();
        lcd.print(" Pin Accepted ");
        digitalWrite(greenLED, HIGH);
        delay (3000);
        digitalWrite(greenLED, LOW);
        lcd.clear();
        
        j = 0;
        
      
   ; // Make finger mode true 
      }
      else //if pin is wrong
      {
        lcd.clear();
        lcd.print(" Wrong Pin ");
        digitalWrite(redLED, HIGH);
        delay (3000);
        digitalWrite(redLED, LOW);
        lcd.clear();
        j = 0;
        RfidMode = true; // Make rfid mode true
      }
    }
//---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if ( FingerMode == true){
  {
  getFingerprintIDez();
  delay(50);            //don't ned to run this at full speed.
}
  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print(" scan finger");
  
}


  }
}