Due to high demand, expect some shipping delays at this time - orders may not ship for up to 2-3 business days.
0

Using getTemplateCount function in Adafruit_Fingerprint libr
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Using getTemplateCount function in Adafruit_Fingerprint libr

by SttMJ on Wed Jan 19, 2022 6:28 am

Our project consists of using the sensor in question to store fingerprints in an orderly manner without having to manually enter the slot where they are to be stored. We think that the function getTemplateCount can help us in this task by indicating the number of fingerprints saved, and therefore, the place where we would have to save the next one. The problem we have is how to access the information that the function theoretically provides us with.

The code fragment that we think can solve the problem:

/**/
/*!
@brief Ask the sensor for the number of templates stored in memory. The
number is stored in <b>templateCount</b> on success.
@returns <code>FINGERPRINT_OK</code> on success
@returns <code>FINGERPRINT_PACKETRECIEVEERR</code> on communication error
*/
/**/
uint8_t Adafruit_Fingerprint::getTemplateCount(void) {
GET_CMD_PACKET(FINGERPRINT_TEMPLATECOUNT);

templateCount = packet.data[1];
templateCount <<= 8;
templateCount |= packet.data[2];

return packet.data[0];
}
The operation that we believe that it should have would be the following: the first person would enroll into the system and be saved on slot 1, then at the moment that the second person puts the print the function getTemplateCount, this will tell us the slots saved to save this second print in the second slot.

We do not plan to use a counter variable in the process because if for example the light is turned off (it will be used in a centre), this variable will be lost.

If you have any other way to solve this problem, please comment it too!

Thanks

SttMJ
 
Posts: 1
Joined: Wed Jan 19, 2022 5:58 am

Please be positive and constructive with your questions and comments.