Below code is an example to send success authorization and alert on wrong finger print scan.
#include
//ADD finger print libraries and other declarations
SoftwareSerial sgsm(2, 3);
void setup()
{
sgsm.begin(9600);
}
void loop()
{
sgsm.listen();
//The below if Condition depends on the fingerprint library you are using.
//Replace with your own condition check method.
//condition should be properly used so as to prevent repeated false messages.
if (finger.verifyPassword()) {
sgsm.print(“\r”);
delay(1000);
sgsm.print(“AT+CMGF=1\r”);
delay(1000);
/*Replace XXXXXXXXXX to 10 digit mobile number &
ZZ to 2 digit country code*/
sgsm.print(“AT+CMGS=\”+ZZXXXXXXXXXX\”\r”);
delay(1000);
//The text of the message to be sent.
sgsm.print(“Authorization Success”);
delay(1000);
sgsm.write(0x1A);
delay(1000);
}
else {
sgsm.print(“\r”);
delay(1000);
sgsm.print(“AT+CMGF=1\r”);
delay(1000);
/*Replace XXXXXXXXXX to 10 digit mobile number &
ZZ to 2 digit country code*/
sgsm.print(“AT+CMGS=\”+ZZXXXXXXXXXX\”\r”);
delay(1000);
//The text of the message to be sent.
sgsm.print(“alert wrong fingerprint”);
delay(1000);
sgsm.write(0x1A);
delay(1000);
}
}
Below code is an example to send success authorization and alert on wrong finger print scan.
#include
//ADD finger print libraries and other declarations
SoftwareSerial sgsm(2, 3);
void setup()
{
sgsm.begin(9600);
}
void loop()
{
sgsm.listen();
//The below if Condition depends on the fingerprint library you are using.
//Replace with your own condition check method.
//condition should be properly used so as to prevent repeated false messages.
if (finger.verifyPassword()) {
sgsm.print(“\r”);
delay(1000);
sgsm.print(“AT+CMGF=1\r”);
delay(1000);
/*Replace XXXXXXXXXX to 10 digit mobile number &
ZZ to 2 digit country code*/
sgsm.print(“AT+CMGS=\”+ZZXXXXXXXXXX\”\r”);
delay(1000);
//The text of the message to be sent.
sgsm.print(“Authorization Success”);
delay(1000);
sgsm.write(0x1A);
delay(1000);
}
else {
sgsm.print(“\r”);
delay(1000);
sgsm.print(“AT+CMGF=1\r”);
delay(1000);
/*Replace XXXXXXXXXX to 10 digit mobile number &
ZZ to 2 digit country code*/
sgsm.print(“AT+CMGS=\”+ZZXXXXXXXXXX\”\r”);
delay(1000);
//The text of the message to be sent.
sgsm.print(“alert wrong fingerprint”);
delay(1000);
sgsm.write(0x1A);
delay(1000);
}
}