This is a repository for code relating to mbed Fitness Tracker
Dependencies: mbed PulseSensor2 SCP1000 mbed-rtos 4DGL-uLCD-SE LSM9DS1_Library_cal PinDetect FatFileSystemCpp GP-20U7
Revision 11:94fb690c9a5f, committed 2020-03-28
- Comitter:
- memig3
- Date:
- Sat Mar 28 14:42:29 2020 +0000
- Parent:
- 10:aecee7025286
- Child:
- 12:30901c1f9eed
- Commit message:
- fingerprint library;
Changed in this revision
GT511C3.lib | Show annotated file Show diff for this revision Revisions of this file |
fingerprint_scanner.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/GT511C3.lib Sat Mar 28 14:42:29 2020 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/tosihisa/code/GT511C3/#90c64cb9db58
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/fingerprint_scanner.cpp Sat Mar 28 14:42:29 2020 +0000 @@ -0,0 +1,61 @@ +#include "mbed.h" +#include "GT511C3.hpp" + +Serial debug(USBTX,USBRX); + +DigitalOut myled(LED1); +GT511C3 finger(p13,p14); + +int progress(int status,char *msg) +{ + debug.printf("%s",msg); + return 0; +} + +int main() { + int sts = 0; + int ID = 0; + + debug.format(8,Serial::None,1); + debug.baud(115200); + + debug.printf("Fingerprint reader module \"GT-511C3 / GT-511C31\" test program.\n"); + debug.printf("Build: %s %s\n",__DATE__,__TIME__); + + debug.printf("Open\n"); + sts = finger.Open(); + debug.printf("sts = %d\n",sts); + if(sts == 0){ + int i; + debug.printf("FirmwareVersion = %lx\n",finger.FirmwareVersion); + debug.printf("IsoAreaMaxSize = %ld\n",finger.IsoAreaMaxSize); + debug.printf("DeviceSerialNumber = "); + for(i = 0; i < sizeof(finger.DeviceSerialNumber);i++){ + debug.printf("%02X",finger.DeviceSerialNumber[i]); + } + debug.printf("\n"); + } + + if(1){ + int EnrollID = 11; + if(finger.CheckEnrolled(EnrollID) == 0){ + debug.printf("EnrollID(%d) is already enrolled.Delete!\n",EnrollID); + if(finger.DeleteID(EnrollID) == 0){ + debug.printf("Delete OK!\n"); + } + } + finger.Enroll(EnrollID,progress); + } + + finger.CmosLed(1); + while(1) { + debug.printf("Press finger for Identify\n"); + finger.WaitPress(1); + if(finger.Capture(1) != 0) + continue; + ID = finger.Identify(); + debug.printf("ID = %d\n",ID); + debug.printf("Remove finger\n"); + finger.WaitPress(0); + } +}