LED blinking while enrolling to indicate when to put finger (ON), and remove finger (OFF)

Fork of GT511C3 by Toshihisa T

Files at this revision

API Documentation at this revision

Comitter:
inezraharjo
Date:
Thu Dec 10 07:55:54 2015 +0000
Parent:
0:90c64cb9db58
Commit message:
LED blinking for the enrolling process;

Changed in this revision

GT511C3.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 90c64cb9db58 -r 1bd535454918 GT511C3.cpp
--- a/GT511C3.cpp	Fri Jan 03 16:00:00 2014 +0000
+++ b/GT511C3.cpp	Thu Dec 10 07:55:54 2015 +0000
@@ -260,8 +260,9 @@
     CmosLed(1);
 
     while(1){
-        if((sts = (*progress)(1,"EnrollStart\n")) != 0)
+        if((sts = (*progress)(1,"EnrollStart\n")) != 0){
             return -9999;
+        }
         Parameter = ID;
         sts = SendRecv(CMD_EnrollStart,&Parameter,&Response);
         if(sts != 0)
@@ -269,48 +270,64 @@
         if(Response != CMD_Ack)
             return -100;
 
-        if((sts = (*progress)(0,"Remove finger\n")) != 0)
+        if((sts = (*progress)(0,"Remove finger\n")) != 0){
             return -9999;
+        }
+        CmosLed(0);
         WaitPress(0);
-
+        CmosLed(1);
+            
         while(1){
-            if((sts = (*progress)(10,"Press finger to Enroll (1st)\n")) != 0)
+            if((sts = (*progress)(10,"Press finger to Enroll (1st)\n")) != 0){
                 return -9999;
+            }
             WaitPress(1);
             if(Capture(1) == 0)
                 break;
         }
 
-        if((sts = (*progress)(0,"Remove finger\n")) != 0)
+        if((sts = (*progress)(0,"Remove finger\n")) != 0){
             return -9999;
+        }
+        CmosLed(0);
+        
         if(Enroll_N(1) != 0)
             continue;
+        
         WaitPress(0);
-
+        CmosLed(1);
+            
         while(1){
-            if((sts = (*progress)(20,"Press finger to Enroll (2nd)\n")) != 0)
+            if((sts = (*progress)(20,"Press finger to Enroll (2nd)\n")) != 0){
                 return -9999;
+            }
             WaitPress(1);
             if(Capture(1) == 0)
                 break;
         }
 
-        if((sts = (*progress)(0,"Remove finger\n")) != 0)
+        if((sts = (*progress)(0,"Remove finger\n")) != 0){
             return -9999;
+        }
+        CmosLed(0);
         if(Enroll_N(2) != 0)
             continue;
         WaitPress(0);
-
+        CmosLed(1);
         while(1){
-            if((sts = (*progress)(30,"Press finger to Enroll (3rd)\n")) != 0)
+            if((sts = (*progress)(30,"Press finger to Enroll (3rd)\n")) != 0){
+                CmosLed(1);
                 return -9999;
+            }
             WaitPress(1);
             if(Capture(1) == 0)
                 break;
         }
 
-        if((sts = (*progress)(0,"Remove finger\n")) != 0)
+        if((sts = (*progress)(0,"Remove finger\n")) != 0){
             return -9999;
+        }
+        CmosLed(0);
         if(Enroll_N(3) != 0)
             continue;
         WaitPress(0);