0% found this document useful (0 votes)
38 views1 page

Fingerprint Buzzer Control Notes PDF

Cont

Uploaded by

claussimon1418
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views1 page

Fingerprint Buzzer Control Notes PDF

Cont

Uploaded by

claussimon1418
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

​#include <Adafruit_Fingerprint.

h>
#define LED_PIN 13 // Define the digital LED pin

SoftwareSerial mySerial(2, 3); // RX, TX for fingerprint module


Adafruit_Fingerprint finger = Adafruit_Fingerprint(&mySerial);

void setup() {
pinMode(LED_PIN, OUTPUT); // Set the LED pin as an output
finger.begin(57600);
if (finger.verifyPassword()) {
Serial.println("Fingerprint module connected");
} else {
Serial.println("Fingerprint module error");
while (1); // Halt if module connection fails
}
}

void loop() {
if (verifyFingerprint()) {
digitalWrite(LED_PIN, HIGH); // Turn on the LED
delay(2000); // LED on for 2 seconds
digitalWrite(LED_PIN, LOW); // Turn off the LED
delay(1000); // Delay before next verification
}
}

bool verifyFingerprint() {
uint8_t id = finger.getImage();
if (id != FINGERPRINT_OK) {
return false; // No fingerprint detected
}
id = finger.image2Tz();
if (id != FINGERPRINT_OK) {
return false; // Image conversion failed
}
id = finger.fingerFastSearch();
if (id == FINGERPRINT_OK) {
finger.fingerFastSearch(); // Search again for multiple verifications
return true; // Fingerprint verified
} else {
return false; // Verification failed
}
}

You might also like