dkanday
September 9, 2021, 1:57pm
4
dkanday:
uint8_t fingerTemplate[512]; // the real template
memset(fingerTemplate, 0xff, 512);
// filtering only the data packets
int uindx = 9, index = 0;
while (index < 534) {
while (index < uindx) ++index;
uindx += 256;
while (index < uindx) {
fingerTemplate[index++] = bytesReceived[index];
}
uindx += 2;
while (index < uindx) ++index;
uindx = index + 9;
}
for (int i = 0; i < 512; ++i) {
//Serial.print("0x");
printHex(fingerTemplate[i], 2);
//Serial.print(", ");
}
Serial.println("\ndone.");
}
//print the fingerprint template
void printHex(int num, int precision) {
char tmp[16];
char format[128];
sprintf(format, "%%.%dX", precision);
sprintf(tmp, format, num);
Serial.print(tmp);
This code is an example code from Adafruit for its fingerprint sensor, to scan the fingerprint and give its signature on the serial monitor.
I am trying to capture the signatures and store it in a database.