Controlling access to the relay

Now that your fingerprint is stored in the sensor, you can build your first application using the hardware that we previously built. We are going to open or close the relay every time the sensor recognizes our fingerprint. The following is the complete code for this part, excluding the details about recognition functions:

// Libraries #include <Adafruit_Fingerprint.h> #include <SoftwareSerial.h> // Function to get fingerprint int getFingerprintIDez(); // Init Software Serial SoftwareSerial mySerial(2, 3); // Fingerprint sensor instance Adafruit_Fingerprint finger = Adafruit_Fingerprint(andmySerial); // Relay parameters int relayPin = 7; bool relayState = false; // Your stored finger ID int fingerID = 0; // Counters ...

Get Arduino: Building exciting LED based projects and espionage devices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.