Program for R306 fingerprint module interfaced with Wiz750SR S2E device

Dependencies:   FPC_R306 MQTT WIZnetInterface mbed

Fork of GT511C3_TimeStamp_WIZwiki-W7500 by WIZnet

main.cpp

Committer:
tosihisa
Date:
2014-01-03
Revision:
5:d3ebe6d1ed92
Parent:
4:3dd0f98e6f09
Child:
6:016ad8f480d3

File content as of revision 5:d3ebe6d1ed92:

#include "mbed.h"
#include "GT511C3.h"

Serial debug(USBTX,USBRX);

DigitalOut myled(LED1);
GT511C3 finger(p28,p27);

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("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){
        finger.Enroll(11,progress);
    }

    finger.CmosLed(1);
    while(1) {
        debug.printf("Press finger\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);
    }
}