Hi guys please im having ESP32 PSRAM Timer Camera X and i bought Finger Print Sensor Unit (FPC1020A), please could someone help me create some test code if fingerprint sensor is working. Its connected via Grove Cable. I cant make it work.... like im not getting any value .. Maybe i just doing some mistake with rx, tx. i just dont know how to make it.
#include "M5_FPC1020A.h"
FingerPrint Finger;
void setup() {
Serial.begin(115200);
delay(2000);
Serial.println("FingerPrint Sensor Setup");
uint8_t rx = 13;
uint8_t tx = 4;
Finger.begin(&Serial2, rx, tx);
}
void loop() {
uint8_t addUserResult = Finger.fpm_addUser(1, 1);
if (addUserResult == ACK_SUCCESS) {
Serial.println("User added successfully!");
} else {
Serial.print("Failed to add user. Error code: ");
Serial.println(addUserResult);
}
// Compare fingerprints
uint8_t compareResult = Finger.fpm_compareFinger();
if (compareResult == ACK_SUCCESS) {
Serial.println("Fingerprints match!");
} else if (compareResult == ACK_NOUSER) {
Serial.println("No fingerprints enrolled.");
} else if (compareResult == ACK_TIMEOUT) {
Serial.println("Fingerprint matching timeout.");
} else {
Serial.print("Fingerprints do not match. Error code: ");
Serial.println(compareResult);
}
delay(10000);
}