Skip to content

Commit fb7a275

Browse files
author
Bobby Chan
committed
Add more comments
- Add comments to reflect tests on GT-521F52 and GT-521F32 - Add comments to change parameter when using with GT-521F52 since it is able to hold 3000 IDs.
1 parent 13b8ba4 commit fb7a275

File tree

6 files changed

+60
-27
lines changed

6 files changed

+60
-27
lines changed

examples/FPS_Blink/FPS_Blink.ino

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
This code should work with the any model of ADH-Tech's FPS as long as
1212
you are within the minimum logic level threshold for the FPS serial UART.
1313
This code has been tested with these models:
14-
14+
15+
GT-521F52 [ https://www.sparkfun.com/products/14585 ]
16+
GT-521F32 [ https://www.sparkfun.com/products/14518 ]
1517
GT-511C3 [ https://www.sparkfun.com/products/11792 ]
1618
GT-511C1R [ https://www.sparkfun.com/products/13007 ]
1719
@@ -56,8 +58,8 @@ Note: You can add the two 10kOhm resistors in series for 20kOhms. =)
5658
// FPS (RX) is connected through a converter to pin 5 (Arduino's Software TX)
5759
FPS_GT511C3 fps(4, 5); // (Arduino SS_RX = pin 4, Arduino SS_TX = pin 5)
5860

59-
/*If using another Arduino microcontroller, try commenting out line 57 and
60-
uncommenting line 66 due to the limitations listed in the
61+
/*If using another Arduino microcontroller, try commenting out line 59 and
62+
uncommenting line 68 due to the limitations listed in the
6163
library's note => https://www.arduino.cc/en/Reference/softwareSerial . Do
6264
not forget to rewire the connection to the Arduino*/
6365

examples/FPS_Enroll/FPS_Enroll.ino

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
This code should work with the any model of ADH-Tech's FPS as long as
1212
you are within the minimum logic level threshold for the FPS serial UART.
1313
This code has been tested with these models:
14-
14+
15+
GT-521F52 [ https://www.sparkfun.com/products/14585 ]
16+
GT-521F32 [ https://www.sparkfun.com/products/14518 ]
1517
GT-511C3 [ https://www.sparkfun.com/products/11792 ]
1618
GT-511C1R [ https://www.sparkfun.com/products/13007 ]
1719
@@ -57,8 +59,8 @@ Note: You can add the two 10kOhm resistors in series for 20kOhms. =)
5759
// FPS (RX) is connected through a converter to pin 5 (Arduino's Software TX)
5860
FPS_GT511C3 fps(4, 5); // (Arduino SS_RX = pin 4, Arduino SS_TX = pin 5)
5961

60-
/*If using another Arduino microcontroller, try commenting out line 58 and
61-
uncommenting line 67 due to the limitations listed in the
62+
/*If using another Arduino microcontroller, try commenting out line 60 and
63+
uncommenting line 69 due to the limitations listed in the
6264
library's note => https://www.arduino.cc/en/Reference/softwareSerial . Do
6365
not forget to rewire the connection to the Arduino*/
6466

examples/FPS_IDFinger/FPS_IDFinger.ino

+10-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
This code should work with the any model of ADH-Tech's FPS as long as
1212
you are within the minimum logic level threshold for the FPS serial UART.
1313
This code has been tested with these models:
14-
14+
15+
GT-521F52 [ https://www.sparkfun.com/products/14585 ]
16+
GT-521F32 [ https://www.sparkfun.com/products/14518 ]
1517
GT-511C3 [ https://www.sparkfun.com/products/11792 ]
1618
GT-511C1R [ https://www.sparkfun.com/products/13007 ]
1719
@@ -50,8 +52,8 @@ Note: You can add the two 10kOhm resistors in series for 20kOhms. =)
5052
// FPS (RX) is connected through a converter to pin 5 (Arduino's Software TX)
5153
FPS_GT511C3 fps(4, 5); // (Arduino SS_RX = pin 4, Arduino SS_TX = pin 5)
5254

53-
/*If using another Arduino microcontroller, try commenting out line 51 and
54-
uncommenting line 60 due to the limitations listed in the
55+
/*If using another Arduino microcontroller, try commenting out line 53 and
56+
uncommenting line 62 due to the limitations listed in the
5557
library's note => https://www.arduino.cc/en/Reference/softwareSerial . Do
5658
not forget to rewire the connection to the Arduino*/
5759

@@ -75,11 +77,13 @@ void loop()
7577
fps.CaptureFinger(false);
7678
int id = fps.Identify1_N();
7779

78-
/*Note : GT-511C3 can hold 200 fingerprint templates.
79-
GT-511C1R can hold 20 fingerprint templates.
80+
/*Note: GT-521F52 can hold 3000 fingerprint templates
81+
GT-521F32 can hold 200 fingerprint templates
82+
GT-511C3 can hold 200 fingerprint templates.
83+
GT-511C1R can hold 20 fingerprint templates.
8084
Make sure to change the id depending on what
8185
model you are using */
82-
if (id <200)
86+
if (id <200) //<- change id value depending model you are using
8387
{//if the fingerprint matches, provide the matching template ID
8488
Serial.print("Verified ID:");
8589
Serial.println(id);

examples/FPS_Serial_Passthrough/FPS_Serial_Passthrough.ino

+4-2
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
* you are within the minimum logic level threshold for the FPS serial UART.
1111
* This code has been tested with these models:
1212
*
13+
* GT-521F52 [ https://www.sparkfun.com/products/14585 ]
14+
* GT-521F32 [ https://www.sparkfun.com/products/14518 ]
1315
* GT-511C3 [ https://www.sparkfun.com/products/11792 ]
1416
* GT-511C1R [ https://www.sparkfun.com/products/13007 ]
1517
*
@@ -63,8 +65,8 @@ Note: You can add the two 10kOhm resistors in series for 20kOhms. =)
6365
// FPS (RX) is connected through a converter to pin 5 (Arduino's Software TX)
6466
SoftwareSerial fps(4, 5); // (Arduino SS_RX = pin 4, Arduino SS_TX = pin 5)
6567

66-
/*If using another Arduino microcontroller, try commenting out line 64 and
67-
uncommenting line 73 due to the limitations listed in the
68+
/*If using another Arduino microcontroller, try commenting out line 66 and
69+
uncommenting line 75 due to the limitations listed in the
6870
library's note => https://www.arduino.cc/en/Reference/softwareSerial . Do
6971
not forget to rewire the connection to the Arduino.*/
7072

src/FPS_GT511C3.cpp

+23-7
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,8 @@ int FPS_GT511C3::GetEnrollCount()
374374
}
375375

376376
// checks to see if the ID number is in use or not
377-
// Parameter: 0-199
377+
// Parameter: 0-2999, if using GT-521F52
378+
// 0-199, if using GT-521F32/GT-511C3
378379
// Return: True if the ID number is enrolled, false if not
379380
bool FPS_GT511C3::CheckEnrolled(int id)
380381
{
@@ -394,7 +395,8 @@ bool FPS_GT511C3::CheckEnrolled(int id)
394395
}
395396

396397
// Starts the Enrollment Process
397-
// Parameter: 0-199
398+
// Parameter: 0-2999, if using GT-521F52
399+
// 0-199, if using GT-521F32/GT-511C3
398400
// Return:
399401
// 0 - ACK
400402
// 1 - Database is full
@@ -439,6 +441,8 @@ int FPS_GT511C3::Enroll1()
439441
delete packetbytes;
440442
Response_Packet* rp = GetResponse();
441443
int retval = rp->IntFromParameter();
444+
//Change to "retval < 3000", if using GT-521F52
445+
//Leave "reval < 200", if using GT-521F32/GT-511C3
442446
if (retval < 200) retval = 3; else retval = 0;
443447
if (rp->ACK == false)
444448
{
@@ -466,6 +470,8 @@ int FPS_GT511C3::Enroll2()
466470
delete packetbytes;
467471
Response_Packet* rp = GetResponse();
468472
int retval = rp->IntFromParameter();
473+
//Change to "retval < 3000", if using GT-521F52
474+
//Leave "reval < 200", if using GT-521F32/GT-511C3
469475
if (retval < 200) retval = 3; else retval = 0;
470476
if (rp->ACK == false)
471477
{
@@ -494,7 +500,9 @@ int FPS_GT511C3::Enroll3()
494500
delete packetbytes;
495501
Response_Packet* rp = GetResponse();
496502
int retval = rp->IntFromParameter();
497-
if (retval < 200) retval = 3; else retval = 0;
503+
//Change to "retval < 3000", if using GT-521F52
504+
//Leave "reval < 200", if using GT-521F32/GT-511C3
505+
if (retval < 200) retval = 3; else retval = 0;
498506
if (rp->ACK == false)
499507
{
500508
if (rp->Error == Response_Packet::ErrorCodes::NACK_ENROLL_FAILED) retval = 1;
@@ -527,7 +535,8 @@ bool FPS_GT511C3::IsPressFinger()
527535
}
528536

529537
// Deletes the specified ID (enrollment) from the database
530-
// Parameter: 0-199 (id number to be deleted)
538+
// Parameter: 0-2999, if using GT-521F52 (id number to be deleted)
539+
// 0-199, if using GT-521F32/GT-511C3(id number to be deleted)
531540
// Returns: true if successful, false if position invalid
532541
bool FPS_GT511C3::DeleteID(int id)
533542
{
@@ -563,7 +572,8 @@ bool FPS_GT511C3::DeleteAll()
563572
}
564573

565574
// Checks the currently pressed finger against a specific ID
566-
// Parameter: 0-199 (id number to be checked)
575+
// Parameter: 0-2999, if using GT-521F52 (id number to be checked)
576+
// 0-199, if using GT-521F32/GT-511C3 (id number to be checked)
567577
// Returns:
568578
// 0 - Verified OK (the correct finger)
569579
// 1 - Invalid Position
@@ -594,8 +604,12 @@ int FPS_GT511C3::Verify1_1(int id)
594604

595605
// Checks the currently pressed finger against all enrolled fingerprints
596606
// Returns:
597-
// 0-199: Verified against the specified ID (found, and here is the ID number)
598-
// 200: Failed to find the fingerprint in the database
607+
// Verified against the specified ID (found, and here is the ID number)
608+
// 0-2999, if using GT-521F52
609+
// 0-199, if using GT-521F32/GT-511C3
610+
// Failed to find the fingerprint in the database
611+
// 3000, if using GT-521F52
612+
// 200, if using GT-521F32/GT-511C3
599613
int FPS_GT511C3::Identify1_N()
600614
{
601615
if (UseSerialDebug) Serial.println("FPS - Identify1_N");
@@ -606,6 +620,8 @@ int FPS_GT511C3::Identify1_N()
606620
SendCommand(packetbytes, 12);
607621
Response_Packet* rp = GetResponse();
608622
int retval = rp->IntFromParameter();
623+
//Change to "retval > 3000" and "retval = 3000", if using GT-521F52
624+
//Leave "reval > 200" and "retval = 200", if using GT-521F32/GT-511C3
609625
if (retval > 200) retval = 200;
610626
delete rp;
611627
delete packetbytes;

src/FPS_GT511C3.h

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
FPS_GT511C3.h v1.0 - Library for controlling the GT-511C3 Finger Print Scanner (FPS)
33
Created by Josh Hawley, July 23rd 2013
44
Licensed for non-commercial use, must include this license message
@@ -214,12 +214,14 @@ class FPS_GT511C3
214214
int GetEnrollCount();
215215

216216
// checks to see if the ID number is in use or not
217-
// Parameter: 0-199
217+
// Parameter: 0-2999, if using GT-521F52
218+
// 0-199, if using GT-521F32/GT-511C3
218219
// Return: True if the ID number is enrolled, false if not
219220
bool CheckEnrolled(int id);
220221

221222
// Starts the Enrollment Process
222-
// Parameter: 0-199
223+
// Parameter: 0-2999, if using GT-521F52
224+
// 0-199, if using GT-521F32/GT-511C3
223225
// Return:
224226
// 0 - ACK
225227
// 1 - Database is full
@@ -265,7 +267,8 @@ class FPS_GT511C3
265267
bool DeleteAll();
266268

267269
// Checks the currently pressed finger against a specific ID
268-
// Parameter: 0-199 (id number to be checked)
270+
// Parameter: 0-2999, if using GT-521F52 (id number to be checked)
271+
// 0-199, if using GT-521F32/GT-511C3 (id number to be checked)
269272
// Returns:
270273
// 0 - Verified OK (the correct finger)
271274
// 1 - Invalid Position
@@ -275,8 +278,12 @@ class FPS_GT511C3
275278

276279
// Checks the currently pressed finger against all enrolled fingerprints
277280
// Returns:
278-
// 0-199: Verified against the specified ID (found, and here is the ID number)
279-
// 200: Failed to find the fingerprint in the database
281+
// Verified against the specified ID (found, and here is the ID number)
282+
// 0-2999, if using GT-521F52
283+
// 0-199, if using GT-521F32/GT-511C3
284+
// Failed to find the fingerprint in the database
285+
// 3000, if using GT-521F52
286+
// 200, if using GT-521F32/GT-511C3
280287
int Identify1_N();
281288

282289
// Captures the currently pressed finger into onboard ram

0 commit comments

Comments
 (0)