Program for R306 fingerprint module interfaced with Wiz750SR S2E device
Dependencies: FPC_R306 MQTT WIZnetInterface mbed
Fork of GT511C3_TimeStamp_WIZwiki-W7500 by
main.cpp@6:016ad8f480d3, 2014-01-03 (annotated)
- Committer:
- tosihisa
- Date:
- Fri Jan 03 15:52:29 2014 +0000
- Revision:
- 6:016ad8f480d3
- Parent:
- 5:d3ebe6d1ed92
- Child:
- 7:8b9ef3211cd0
Add CheckEnrolled() and DeleteID().;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tosihisa | 0:b11b455d4997 | 1 | #include "mbed.h" |
tosihisa | 6:016ad8f480d3 | 2 | #include "GT511C3.hpp" |
tosihisa | 0:b11b455d4997 | 3 | |
tosihisa | 0:b11b455d4997 | 4 | Serial debug(USBTX,USBRX); |
tosihisa | 0:b11b455d4997 | 5 | |
tosihisa | 0:b11b455d4997 | 6 | DigitalOut myled(LED1); |
tosihisa | 0:b11b455d4997 | 7 | GT511C3 finger(p28,p27); |
tosihisa | 0:b11b455d4997 | 8 | |
tosihisa | 5:d3ebe6d1ed92 | 9 | int progress(int status,char *msg) |
tosihisa | 2:34a647292050 | 10 | { |
tosihisa | 5:d3ebe6d1ed92 | 11 | debug.printf("%s",msg); |
tosihisa | 3:459a4f985a45 | 12 | return 0; |
tosihisa | 2:34a647292050 | 13 | } |
tosihisa | 2:34a647292050 | 14 | |
tosihisa | 0:b11b455d4997 | 15 | int main() { |
tosihisa | 0:b11b455d4997 | 16 | int sts = 0; |
tosihisa | 4:3dd0f98e6f09 | 17 | int ID = 0; |
tosihisa | 0:b11b455d4997 | 18 | |
tosihisa | 0:b11b455d4997 | 19 | debug.format(8,Serial::None,1); |
tosihisa | 0:b11b455d4997 | 20 | debug.baud(115200); |
tosihisa | 0:b11b455d4997 | 21 | |
tosihisa | 0:b11b455d4997 | 22 | debug.printf("Open\n"); |
tosihisa | 4:3dd0f98e6f09 | 23 | sts = finger.Open(); |
tosihisa | 4:3dd0f98e6f09 | 24 | debug.printf("sts = %d\n",sts); |
tosihisa | 4:3dd0f98e6f09 | 25 | if(sts == 0){ |
tosihisa | 4:3dd0f98e6f09 | 26 | int i; |
tosihisa | 4:3dd0f98e6f09 | 27 | debug.printf("FirmwareVersion = %lx\n",finger.FirmwareVersion); |
tosihisa | 4:3dd0f98e6f09 | 28 | debug.printf("IsoAreaMaxSize = %ld\n",finger.IsoAreaMaxSize); |
tosihisa | 4:3dd0f98e6f09 | 29 | debug.printf("DeviceSerialNumber = "); |
tosihisa | 4:3dd0f98e6f09 | 30 | for(i = 0; i < sizeof(finger.DeviceSerialNumber);i++){ |
tosihisa | 4:3dd0f98e6f09 | 31 | debug.printf("%02X",finger.DeviceSerialNumber[i]); |
tosihisa | 4:3dd0f98e6f09 | 32 | } |
tosihisa | 4:3dd0f98e6f09 | 33 | debug.printf("\n"); |
tosihisa | 4:3dd0f98e6f09 | 34 | } |
tosihisa | 0:b11b455d4997 | 35 | |
tosihisa | 3:459a4f985a45 | 36 | if(1){ |
tosihisa | 6:016ad8f480d3 | 37 | int EnrollID = 11; |
tosihisa | 6:016ad8f480d3 | 38 | if(finger.CheckEnrolled(EnrollID) == 0){ |
tosihisa | 6:016ad8f480d3 | 39 | debug.printf("EnrollID(%d) is already enrolled.Delete!\n",EnrollID); |
tosihisa | 6:016ad8f480d3 | 40 | if(finger.DeleteID(EnrollID) == 0){ |
tosihisa | 6:016ad8f480d3 | 41 | debug.printf("Delete OK!\n"); |
tosihisa | 6:016ad8f480d3 | 42 | } |
tosihisa | 6:016ad8f480d3 | 43 | } |
tosihisa | 6:016ad8f480d3 | 44 | finger.Enroll(EnrollID,progress); |
tosihisa | 3:459a4f985a45 | 45 | } |
tosihisa | 3:459a4f985a45 | 46 | |
tosihisa | 3:459a4f985a45 | 47 | finger.CmosLed(1); |
tosihisa | 0:b11b455d4997 | 48 | while(1) { |
tosihisa | 6:016ad8f480d3 | 49 | debug.printf("Press finger for Identify\n"); |
tosihisa | 5:d3ebe6d1ed92 | 50 | finger.WaitPress(1); |
tosihisa | 5:d3ebe6d1ed92 | 51 | if(finger.Capture(1) != 0) |
tosihisa | 5:d3ebe6d1ed92 | 52 | continue; |
tosihisa | 5:d3ebe6d1ed92 | 53 | ID = finger.Identify(); |
tosihisa | 5:d3ebe6d1ed92 | 54 | debug.printf("ID = %d\n",ID); |
tosihisa | 5:d3ebe6d1ed92 | 55 | debug.printf("Remove finger\n"); |
tosihisa | 5:d3ebe6d1ed92 | 56 | finger.WaitPress(0); |
tosihisa | 0:b11b455d4997 | 57 | } |
tosihisa | 0:b11b455d4997 | 58 | } |