Fingerprint Sensor

Breakout boards, sensors, other Adafruit kits, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
t701rls
 
Posts: 1
Joined: Tue Aug 06, 2013 11:14 pm

Fingerprint Sensor

Post by t701rls »

Looking at the "Examples" support code for this product, the Sketch titled Enroll has me puzzled. Here's the code:

while (true) {
while (! Serial.available());
char c = Serial.read();
if (! isdigit(c)) break;
id *= 10;
id += c - '0';
}


The "while (true)" is always "true" so how can it possibly ever continue? If you enter a alpha character then a "break" is invoked and the while is exited, otherwise it stays there forever. At least that's how it works on my Arduino Uno + the sensor. Can anybody explain the coding?

Thanks

User avatar
adafruit_support_bill
 
Posts: 88141
Joined: Sat Feb 07, 2009 10:11 am

Re: Fingerprint Sensor

Post by adafruit_support_bill »

The code accepts one or more ASCII digits and calculates the binary value:

Code: Select all

while (true) // loop until we get a non-digit character
{
  while (! Serial.available());  // wait for the next character
  char c = Serial.read();  // read the next character
  if (! isdigit(c)) break;  // exit if it is not a digit

  // At this point, we have a digit, so we use it to calculate the ID
  id *= 10;       // multiply any more-significant digits by 10
  id += c - '0';  // add the binary value of the digit to the total
}

meldia
 
Posts: 1
Joined: Sat Aug 24, 2013 5:55 pm

Re: Fingerprint Sensor

Post by meldia »

hi, I would like to know which algorithm does the sensor use?
And what means "image converted" in the enroll code?

thank you for your answers

User avatar
adafruit_support_bill
 
Posts: 88141
Joined: Sat Feb 07, 2009 10:11 am

Re: Fingerprint Sensor

Post by adafruit_support_bill »

Hi, We do not have any information about the algorithm or internal storage formats, other than what is published in the manual:
http://www.adafruit.com/datasheets/ZFM% ... ualV15.pdf

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Products from Adafruit”