expected error again

Hey guys im learning still here so i hope i posted this code the right way. I see where you guys want tags. So im assuming that a tag is the beginning. Tagging whats wrong with it. If Im wrong can you let me know. Well im in the middle of this code and its nowhere complete. but im at the part where im testing the keypad. So far it was all fine with no errors until now.

Error: expected } at the end of input

I tried all that i have learned and i was able to fix alot of it. But this error is killing me. And again i have alot more to do.

expected } at the end of input

Can someone save my assest yet again. Thanx For all ur help.

#include <Adafruit_Fingerprint.h>
#include <SoftwareSerial.h>
#include <Keypad.h>

char* password = "2647AB";
const byte ROWS = 4;
const byte COLS = 4;
char keys[ROWS] [COLS] = {
{'1', '4', '7', '*'},
{'2', '5', '8', '0'},
{'3', '6', '9', '#'},
{'A', 'B', 'C', 'D'}
};
byte rowPins[ROWS] = {5, 4, 3, 2}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {9, 8, 7, 6};
int position = 0;

int getFingerprintIDez();

// pin #2 is IN from sensor (GREEN wire)
// pin #3 is OUT from arduino (WHITE wire)
SoftwareSerial mySerial(2, 3);
Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

//////////////////////////KEYPAD CONSTRUCTOR/////////////////////////////////////////////

Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); //create instance of Keypad called keypad

/////////////////////////////////////////////////////////////////////////////////////////////////////////////

void setup()
{
while (!Serial);

Serial.begin(9600);
Serial.println("Adafruit finger detect test");
pinMode(11, OUTPUT); // blue led
pinMode(12, OUTPUT); // red led
pinMode(7, OUTPUT); //LED and Buzzer PIN OUT

///////////////////////////////////LED FUNCTIONS//////////////////////////////////////////////////

void unlock();
digitalWrite(11, HIGH); // turn on blue led
digitalWrite(12, LOW); // turn off red led
//digitalWrite(13,HIGH); // turn on relay

void lock() ;
digitalWrite(11, LOW); // turn off blue led
digitalWrite(12, HIGH); // turn on red led
//digitalWrite(13,LOW); // turn off relay

///////////////////////////////////////////////////////////////////////////////////////

// set the data rate for the sensor serial port
finger.begin(57600);

if (finger.verifyPassword()) {
Serial.println("Found fingerprint sensor!");
} else {
Serial.println("Did not find fingerprint sensor :(");
while (1);
}
Serial.println("Waiting for valid finger...");
}

void loop() // run over and over again
{
getFingerprintIDez();
digitalWrite(12, HIGH);
digitalWrite(7, HIGH);
}
uint8_t getFingerprintID() {
uint8_t p = finger.getImage();
switch (p) {
case FINGERPRINT_OK:
Serial.println("Image taken");
break;
case FINGERPRINT_NOFINGER:
Serial.println("No finger detected");
return p;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("Communication error");
return p;
case FINGERPRINT_IMAGEFAIL:
Serial.println("Imaging error");
return p;
default:
Serial.println("Unknown error");
return p;
}

// OK success!

p = finger.image2Tz();
switch (p) {
case FINGERPRINT_OK:
Serial.println("Image converted");
break;
case FINGERPRINT_IMAGEMESS:
Serial.println("Image too messy");
return p;
case FINGERPRINT_PACKETRECIEVEERR:
Serial.println("Communication error");
return p;
case FINGERPRINT_FEATUREFAIL:
Serial.println("Could not find fingerprint features");
return p;
case FINGERPRINT_INVALIDIMAGE:
Serial.println("Could not find fingerprint features");
return p;
default:
Serial.println("Unknown error");
return p;
}

// OK converted!
p = finger.fingerFastSearch();
if (p == FINGERPRINT_OK) {
Serial.println("Found a print match!");
} else if (p == FINGERPRINT_PACKETRECIEVEERR) {
Serial.println("Communication error");
return p;
} else if (p == FINGERPRINT_NOTFOUND) {
Serial.println("Did not find a match");
return p;
} else {
Serial.println("Unknown error");
return p;
}

// found a match!
// 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;

{
char key = keypad.getKey();
if (key == '*' || key == '#')

{
position = 0;

{
if (key == password[position])
{
position ++;
{
if (position == 4)

{

delay (1000);

}

// found a match!
digitalWrite(12, LOW); // set the red led off
digitalWrite(11, HIGH); //set the blue led on
digitalWrite(7, HIGH); // set buzzer on to verify print
delay(2000); // wait for a 2 seconds
digitalWrite(11, LOW); //set the blue led off
digitalWrite(7, LOW); // set buzzer off when blue lite is off
delay(2000); // wait for 2 seconds
digitalWrite(12, HIGH); // set the red led on
Serial.print("Found ID #"); Serial.print(finger.fingerID);
Serial.print(" with confidence of "); Serial.println(finger.confidence);
{
Serial.print("Found ID #"); Serial.print(finger.fingerID);
Serial.print(" with confidence of "); Serial.println(finger.confidence);
return finger.fingerID;
} ????????

where i have the ? above here , thats the line where i have an issue. The bracket wont be accepted

Pls help, Thanx so much my arduino family, ozzie

Please use code tags (</> button on the toolbar) when you post code or warning/error messages. The reason is that the forum software can interpret parts of your code as markup, leading to confusion, wasted time, and a reduced chance for you to get help with your problem. This will also make it easier to read your code and to copy it to the IDE or editor. Using code tags and other important information is explained in the How to use this forum post. Please read it.

When your code requires a library that's not included with the Arduino IDE please always post a link (using the chain link icon on the toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger(Sketch > Include Library > Manage Libraries) then say so and state the full name of the library.

Anytime you have one of these: { you need to have one of these: } to match it. After you do a Tools > Auto Format on your code you should look it over to make sure all the indentation is as you expect. In this case you will notice that your last line is indented 6 levels. That's a sure sign of a problem. Your last line of any function should always have no indentation after an auto format.

You'll notice that all your functions except getFingerprintIDez() do end with zero indentation so you know there is a problem in getFingerprintIDez().

You have a few unnecessary braces in there (line 146, 153, 177, 181), that's part of the problem. Get rid of those and do another auto format. Now the last line of the function is only indented 3 levels, that's progress!

So you are still missing three closing braces (}). The Arduino IDE has a helpful feature called matching bracket highlighting. If you position the cursor next to a bracket it will put a little box around the matching bracket. Go through all the opening braces ({) in your code and use matching bracket highlighting to find the ones that don't have a match. Add a match for each of these in the correct place and do another Auto Format. The last line of your function should now be at zero indentation levels and the error should be fixed.

Ok i think i understand the tags issue, but to be sure i will reread the rules and regs. sorry guys im a military vet and barely made it out of highschool in 89. So this is like my biggest achievementt here. I will try and do as u asked.

Now as far as the code i think i get wat ur saying about the mistakes i made. Ill go over it and return with an update. thanx again very much, Ozzie