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