A newbie here, How can I add a FPM10A in my code; I want to hve a two authentication process when the user tap his/her card they also need to scan their fingerprint to open the lock. Here is my code:
#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SPI.h>
#include <MFRC522.h>
#define SS_PIN 10
#define RST_PIN 9
String UID = "F9 FC F4 14";
byte lock = 0;
Servo servo;
LiquidCrystal_I2C lcd(0x27, 16, 2);
MFRC522 rfid(SS_PIN, RST_PIN);
void setup() {
Serial.begin(9600);
servo.write(70);
lcd.init();
lcd.backlight();
servo.attach(3);
SPI.begin();
rfid.PCD_Init();
lcd.setCursor((16 - 7) / 2, 0);
lcd.print("Welcome!");
lcd.setCursor((16 - 13) / 2, 1);
lcd.print("Scan Your Card");
}
void loop() {
if (!rfid.PICC_IsNewCardPresent())
return;
if (!rfid.PICC_ReadCardSerial())
return;
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Scanning");
Serial.print("NUID tag is :");
String ID = "";
for (byte i = 0; i < rfid.uid.size; i++) {
lcd.print(".");
ID.concat(String(rfid.uid.uidByte[i] < 0x10 ? " 0" : " "));
ID.concat(String(rfid.uid.uidByte[i], HEX));
delay(300);
}
ID.toUpperCase();
if (ID.substring(1) == UID && lock == 0) {
servo.write(70);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Door is locked");
delay(2000);
lcd.clear();
lock = 1;
} else if (ID.substring(1) == UID && lock == 1) {
servo.write(160);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Access Granted!");
delay(2000);
lcd.clear();
lock = 0;
} else {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Denied Access!");
delay(2000);
lcd.clear();
lcd.setCursor((16 - 7) / 2, 0);
lcd.print("Welcome!");
lcd.setCursor((16 - 13) / 2, 1);
lcd.print("Scan Your Card");
}
}
Thank in advance for helping me!
A newbie here, How can I add a FPM10A in my code; I want to hve a two authentication process when the user tap his/her card they also need to scan their fingerprint to open the lock. Here is my code:
#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SPI.h>
#include <MFRC522.h>
#define SS_PIN 10
#define RST_PIN 9
String UID = "F9 FC F4 14";
byte lock = 0;
Servo servo;
LiquidCrystal_I2C lcd(0x27, 16, 2);
MFRC522 rfid(SS_PIN, RST_PIN);
void setup() {
Serial.begin(9600);
servo.write(70);
lcd.init();
lcd.backlight();
servo.attach(3);
SPI.begin();
rfid.PCD_Init();
lcd.setCursor((16 - 7) / 2, 0);
lcd.print("Welcome!");
lcd.setCursor((16 - 13) / 2, 1);
lcd.print("Scan Your Card");
}
void loop() {
if (!rfid.PICC_IsNewCardPresent())
return;
if (!rfid.PICC_ReadCardSerial())
return;
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Scanning");
Serial.print("NUID tag is :");
String ID = "";
for (byte i = 0; i < rfid.uid.size; i++) {
lcd.print(".");
ID.concat(String(rfid.uid.uidByte[i] < 0x10 ? " 0" : " "));
ID.concat(String(rfid.uid.uidByte[i], HEX));
delay(300);
}
ID.toUpperCase();
if (ID.substring(1) == UID && lock == 0) {
servo.write(70);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Door is locked");
delay(2000);
lcd.clear();
lock = 1;
} else if (ID.substring(1) == UID && lock == 1) {
servo.write(160);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Access Granted!");
delay(2000);
lcd.clear();
lock = 0;
} else {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Denied Access!");
delay(2000);
lcd.clear();
lcd.setCursor((16 - 7) / 2, 0);
lcd.print("Welcome!");
lcd.setCursor((16 - 13) / 2, 1);
lcd.print("Scan Your Card");
}
}
Thank in advance for helping me!
Sorry I'm new I'll delete one of my post; I try some of them but I can't figure it out
The time to read the rules on forum etiquette in How to get the best out of this forum is really before you post for the first time and step in it by crossposting all over the place.
A newbie here, How can I add a FPM10A in my code; I want to hve a two authentication process when the user tap his/her card they also need to scan their fingerprint to open the lock. Here is my code:
#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
#include <SPI.h>
#include <MFRC522.h>
#define SS_PIN 10
#define RST_PIN 9
String UID = "F9 FC F4 14";
byte lock = 0;
Servo servo;
LiquidCrystal_I2C lcd(0x27, 16, 2);
MFRC522 rfid(SS_PIN, RST_PIN);
void setup() {
Serial.begin(9600);
servo.write(70);
lcd.init();
lcd.backlight();
servo.attach(3);
SPI.begin();
rfid.PCD_Init();
lcd.setCursor((16 - 7) / 2, 0);
lcd.print("Welcome!");
lcd.setCursor((16 - 13) / 2, 1);
lcd.print("Scan Your Card");
}
void loop() {
if (!rfid.PICC_IsNewCardPresent())
return;
if (!rfid.PICC_ReadCardSerial())
return;
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Scanning");
Serial.print("NUID tag is :");
String ID = "";
for (byte i = 0; i < rfid.uid.size; i++) {
lcd.print(".");
ID.concat(String(rfid.uid.uidByte[i] < 0x10 ? " 0" : " "));
ID.concat(String(rfid.uid.uidByte[i], HEX));
delay(300);
}
ID.toUpperCase();
if (ID.substring(1) == UID && lock == 0) {
servo.write(70);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Door is locked");
delay(2000);
lcd.clear();
lock = 1;
} else if (ID.substring(1) == UID && lock == 1) {
servo.write(160);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Access Granted!");
delay(2000);
lcd.clear();
lock = 0;
} else {
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Denied Access!");
delay(2000);
lcd.clear();
lcd.setCursor((16 - 7) / 2, 0);
lcd.print("Welcome!");
lcd.setCursor((16 - 13) / 2, 1);
lcd.print("Scan Your Card");
}
}
What is the problem and what is Your question?
system
Closed
May 14, 2024, 9:39am
9
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.