Intermediate
30 min

Secure your projects with GROW R503 and ATmega328P

Adapt to any challenge with ease

Fingerprint 3 Click with Arduino UNO Rev3

Published Feb 14, 2024

Click board™

Fingerprint 3 Click

Dev. board

Arduino UNO Rev3

Compiler

NECTO Studio

MCU

ATmega328P

Create an efficient access control application that will include an authentication solution

A

A

Hardware Overview

How does it work?

Fingerprint 3 Click is an adapter Click board™ that simplifies the connection of add-on boards to the mikroBUS™ socket. This Click board™ represents a small-size PCB that can be connected to the mikroBUS™ socket like any other Click board™, with a 1x6 1.0mm pitch vertical type wire to board connector placed on itself. Each of the header pins corresponds to a pin on the mikroBUS™ socket being used, such as UART lines (TX, RX), 3V3 power supply, finger detection signal, and Ring LED enable for GROW R503 module and ground. This Click board™ allows easy pin access and manipulation while always retaining a perfect connection quality. Fingerprint processing includes two parts: fingerprint recording and fingerprint matching. The first step is initializing all the necessary drivers, peripherals, and pins. At power-on, it takes about 200ms for initialization; during this period, the module can't accept any commands.

This is followed by checking the sensor and verifying the module password, after which a new fingerprint pattern begins if everything is done correctly. The user needs to enter the finger two times. The system will process the two-time finger images, generate a template of the finger based on processing results, and store the template. When matching, a user enters the finger through an optical sensor, and the system will generate a template of the finger and compare it with templates of the finger library. In both circumstances, the system will return the matching result, success or failure. This can also be seen in an example code that contains easy-to-use functions that may be used as a reference for further development. The Fingerprint 3 Click communicates with MCU using the UART interface with the default baud rate of 57600bps for the data transfer, while the GPIO pins on this Click board™ are used for finger detection and ring indicator LED

enable. Ring indicator LED light labeled as VD can be enabled by toggling the signal routed to the RST pin on the mikroBUS™, while the signal routed to the INT pin on the mikroBUS™ represents an interrupt and indicates the detection of a finger on the module. When the indicator glows purple, the module is in its Stand-By mode and waits for a finger to be pressed. In addition to purple, the module can also glow blue or red, indicating the fingerprint match's correctness (blue indicates that a pair is found, while red indicates that a pair was not found). This Click board™ can only be operated with a 3.3V logic voltage level. The board must perform appropriate logic voltage level conversion before using MCUs with different logic levels. However, the Click board™ comes equipped with a library containing functions and an example code that can be used as a reference for further development.

Fingerprint 3 Click top side image
Fingerprint 3 Click lateral side image
Fingerprint 3 Click bottom side image

Features overview

Development board

Arduino UNO is a versatile microcontroller board built around the ATmega328P chip. It offers extensive connectivity options for various projects, featuring 14 digital input/output pins, six of which are PWM-capable, along with six analog inputs. Its core components include a 16MHz ceramic resonator, a USB connection, a power jack, an

ICSP header, and a reset button, providing everything necessary to power and program the board. The Uno is ready to go, whether connected to a computer via USB or powered by an AC-to-DC adapter or battery. As the first USB Arduino board, it serves as the benchmark for the Arduino platform, with "Uno" symbolizing its status as the

first in a series. This name choice, meaning "one" in Italian, commemorates the launch of Arduino Software (IDE) 1.0. Initially introduced alongside version 1.0 of the Arduino Software (IDE), the Uno has since become the foundational model for subsequent Arduino releases, embodying the platform's evolution.

Arduino UNO Rev3 double side image

Microcontroller Overview

MCU Card / MCU

default

Architecture

AVR

MCU Memory (KB)

32

Silicon Vendor

Microchip

Pin count

28

RAM (Bytes)

2048

You complete me!

Accessories

Click Shield for Arduino UNO has two proprietary mikroBUS™ sockets, allowing all the Click board™ devices to be interfaced with the Arduino UNO board without effort. The Arduino Uno, a microcontroller board based on the ATmega328P, provides an affordable and flexible way for users to try out new concepts and build prototypes with the ATmega328P microcontroller from various combinations of performance, power consumption, and features. The Arduino Uno has 14 digital input/output pins (of which six can be used as PWM outputs), six analog inputs, a 16 MHz ceramic resonator (CSTCE16M0V53-R0), a USB connection, a power jack, an ICSP header, and reset button. Most of the ATmega328P microcontroller pins are brought to the IO pins on the left and right edge of the board, which are then connected to two existing mikroBUS™ sockets. This Click Shield also has several switches that perform functions such as selecting the logic levels of analog signals on mikroBUS™ sockets and selecting logic voltage levels of the mikroBUS™ sockets themselves. Besides, the user is offered the possibility of using any Click board™ with the help of existing bidirectional level-shifting voltage translators, regardless of whether the Click board™ operates at a 3.3V or 5V logic voltage level. Once you connect the Arduino UNO board with our Click Shield for Arduino UNO, you can access hundreds of Click boards™, working with 3.3V or 5V logic voltage levels.

Click Shield for Arduino UNO accessories 1 image

Fingerprint Sensor with Two-Color LED Ring (GROW R503) is a capacitive fingerprint sensor module scanner with a two-color ring indicator. The module is designed in a circular shape with a diameter of 28mm. It's important to mention that this module represents an integrated image-collecting and algorithm chip together. GROW R503 module has an image buffer and six feature file buffers. An important note for users is that all buffer contents are not saved after power failure. A fingerprint pattern template can be composed of 2-6 feature files. If the composite template has more characteristic files, the fingerprint pattern template has better quality. The module's enclosure is dust resistant but not waterproof with a ring indicator LED light controlled by command, and it has a high recognition rate and the flexibility to adapt to different conditions of human fingers, whether it's dry, wet, or a person of different ages. This module can be connected to the Fingerprint 3 Click or to any other product that has a 1.0mm pitch vertical type wire-to-board connector as this module and the appropriate type of communication.

Fingerprint 3 Click accessories image

Used MCU Pins

mikroBUS™ mapper

NC
NC
AN
Ring Indicator LED Enable
PD2
RST
NC
NC
CS
NC
NC
SCK
NC
NC
MISO
NC
NC
MOSI
Power Supply
3.3V
3.3V
Ground
GND
GND
NC
NC
PWM
Fingerprint Detection
PC3
INT
UART TX
PD0
TX
UART RX
PD1
RX
NC
NC
SCL
NC
NC
SDA
NC
NC
5V
Ground
GND
GND
1

Take a closer look

Click board™ Schematic

Fingerprint 3 Click Schematic schematic

Step by step

Project assembly

Click Shield for Arduino UNO front image hardware assembly

Start by selecting your development board and Click board™. Begin with the Arduino UNO Rev3 as your development board.

Click Shield for Arduino UNO front image hardware assembly
Arduino UNO Rev3 front image hardware assembly
Charger 27 Click front image hardware assembly
Prog-cut hardware assembly
Charger 27 Click complete accessories setup image hardware assembly
Arduino UNO Rev3 Access MB 1 - upright/background hardware assembly
Necto image step 2 hardware assembly
Necto image step 3 hardware assembly
Necto image step 4 hardware assembly
Necto image step 5 hardware assembly
Necto image step 6 hardware assembly
Arduino UNO MCU Step hardware assembly
Necto No Display image step 8 hardware assembly
Necto image step 9 hardware assembly
Necto image step 10 hardware assembly
Debug Image Necto Step hardware assembly

Track your results in real time

Application Output

1. Application Output - In Debug mode, the 'Application Output' window enables real-time data monitoring, offering direct insight into execution results. Ensure proper data display by configuring the environment correctly using the provided tutorial.

2. UART Terminal - Use the UART Terminal to monitor data transmission via a USB to UART converter, allowing direct communication between the Click board™ and your development system. Configure the baud rate and other serial settings according to your project's requirements to ensure proper functionality. For step-by-step setup instructions, refer to the provided tutorial.

3. Plot Output - The Plot feature offers a powerful way to visualize real-time sensor data, enabling trend analysis, debugging, and comparison of multiple data points. To set it up correctly, follow the provided tutorial, which includes a step-by-step example of using the Plot feature to display Click board™ readings. To use the Plot feature in your code, use the function: plot(*insert_graph_name*, variable_name);. This is a general format, and it is up to the user to replace 'insert_graph_name' with the actual graph name and 'variable_name' with the parameter to be displayed.

Software Support

Library Description

This library contains API for Fingerprint 3 Click driver.

Key functions:

  • void fingerprint3_parser_rsp ( fingerprint3_rsp_t *response ) - Response parser function.
  • uint8_t fingerprint3_byte_ready ( void ) - Check for new byte received.
  • void fingerprint3_uart_write ( uint8_t *tx_data, uint8_t n_bytes ) - Uart write function.

Open Source

Code example

The complete application code and a ready-to-use project are available through the NECTO Studio Package Manager for direct installation in the NECTO Studio. The application code can also be found on the MIKROE GitHub account.

/*!
 * \file 
 * \brief Fingerprint 3 Click example
 * 
 * # Description
 * This example reads and processes data from Fingerprint 3 clicks.
 *
 * The demo application is composed of two sections :
 * 
 * ## Application Init 
 * Initializes the driver, configures the sensor, and enrolls fingerprints.
 * 
 * ## Application Task  
 * Takes an image of the finger, then checks if there's a fingerprint in the library that matches the
 * one it has just read. All data is being logged on the USB UART.
 * 
 * ## Additional Function
 * - static void display_error ( uint8_t *message )
 * - static void display_full_rsp ( fingerprint3_t *ctx )
 * - static void search_finger( fingerprint3_t *ctx )
 * - static void match_finger( fingerprint3_t *ctx, uint16_t location )
 * - static uint8_t enroll_finger( fingerprint3_t *ctx, uint16_t location, uint8_t features )
 *  
 * \author MikroE Team
 *
 */
// ------------------------------------------------------------------- INCLUDES

#include "board.h"
#include "log.h"
#include "fingerprint3.h"
#include "string.h"

// ------------------------------------------------------------------ VARIABLES

#define LOCATION_IN_LIBRARY            1    // Location in flash where the fingerprint template will be stored.
#define NUMBER_OF_FINGERPRINTS         2    // Number of fingerprints for enrolling.
#define NUMBER_OF_IMAGES               3    // Number of images it will take for a single fingerprint template.

static fingerprint3_t fingerprint3;
static log_t logger;
uint8_t package_content[ FINGERPRINT3_MAX_PACKAGE_LENGTH ];
uint8_t error_check = 0;

// ------------------------------------------------------- ADDITIONAL FUNCTIONS

/**
 * @brief Display error function.
 *
 * @param message  Input string.
 *
 * @details This function concatenates status of response to the input string and prints it on the USB UART.
 */
static void display_error ( uint8_t *message );

/**
 * @brief Display full response function.
 *
 * @param ctx  Click object.
 *
 * @details This function parses and displays full response to the previously sent command on the USB UART.
 */
static void display_full_rsp ( fingerprint3_t *ctx );

/**
 * @brief Search finger function.
 *
 * @param ctx  Click object.
 *
 * @details This function searches the whole finger library for the template that matches the one 
 * it stores in char_buffer 1. All data is being logged on the USB UART.
 */
static void search_finger( fingerprint3_t *ctx );

/**
 * @brief Match finger function.
 *
 * @param ctx       Click object.
 * @param location  Location in library.
 *
 * @details This function checks if the template stored at the desired location matches the fingerprint
 * it reads. All data is being logged on the USB UART.
 */
static void match_finger( fingerprint3_t *ctx, uint16_t location );

/**
 * @brief Enroll finger function.
 *
 * @param ctx       Click object.
 * @param location  Location in library where the fingerprint template will be stored.
 * @param features  Number of fingerprint images it will combine in a template.
 *
 * @details This function enrolls the fingerprint, creates a template combining the taken images and
 *              stores it at the desired location. All data is being logged on the USB UART.
 */
static uint8_t enroll_finger( fingerprint3_t *ctx, uint16_t location, uint8_t features );


// ------------------------------------------------------ APPLICATION FUNCTIONS

void application_init ( void )
{
    log_cfg_t log_cfg;
    fingerprint3_cfg_t cfg;

    /** 
     * Logger initialization.
     * Default baud rate: 115200
     * Default log level: LOG_LEVEL_DEBUG
     * @note If USB_UART_RX and USB_UART_TX 
     * are defined as HAL_PIN_NC, you will 
     * need to define them manually for log to work. 
     * See @b LOG_MAP_USB_UART macro definition for detailed explanation.
     */
    LOG_MAP_USB_UART( log_cfg );
    log_init( &logger, &log_cfg );
    log_info( &logger, "---- Application Init ----" );
    Delay_ms ( 100 );

    //  Click initialization.
    fingerprint3_cfg_setup( &cfg );
    FINGERPRINT3_MAP_MIKROBUS( cfg, MIKROBUS_1 );
    err_t init_flag = fingerprint3_init( &fingerprint3, &cfg );
    if ( init_flag == UART_ERROR ) 
    {
        log_error( &logger, " Application Init Error. " );
        log_info( &logger, " Please, run program again... " );

        for ( ; ; );
    }
    Delay_ms ( 100 );
    
    error_check = fingerprint3_set_config ( &fingerprint3, FINGERPRINT3_DEFAULT_ADDRESS, 
                                                           FINGERPRINT3_DEFAULT_PASSWORD );
    display_error( "Set Config" );
    Delay_ms ( 500 );
    
    error_check = fingerprint3_soft_reset ( &fingerprint3 );
    display_error( "Soft Reset" );
    Delay_ms ( 500 );
    
    error_check = fingerprint3_check_sensor ( &fingerprint3 );
    display_error( "Check Sensor" );
    Delay_ms ( 500 );
    
    error_check = fingerprint3_empty_library ( &fingerprint3 );
    display_error( "Empty the Library" );
    Delay_ms ( 500 );
    
    uint8_t cnt = 0; 
    do 
    {
        log_printf( &logger, " >>>  Register fingerprint %u of %u  <<<\r\n", ( uint16_t ) cnt + 1, 
                                                                             ( uint16_t ) NUMBER_OF_FINGERPRINTS );
        log_printf( &logger, "--------------------------------- \r\n" );
        error_check = enroll_finger ( &fingerprint3, LOCATION_IN_LIBRARY + cnt, NUMBER_OF_IMAGES );
        display_error( "Enroll finger" );
        if ( FINGERPRINT3_OK != error_check )
        {
            log_printf( &logger, " Please enroll your fingerprint again.\r\n" );
            log_printf( &logger, "--------------------------------- \r\n" );
        }
        else
        {
            cnt++;
        }
        Delay_ms ( 1000 );
    }
    while ( FINGERPRINT3_OK != error_check || cnt != NUMBER_OF_FINGERPRINTS );
}

void application_task ( void )
{    
    search_finger( &fingerprint3 );
}

int main ( void ) 
{
    /* Do not remove this line or clock might not be set correctly. */
    #ifdef PREINIT_SUPPORTED
    preinit();
    #endif
    
    application_init( );
    
    for ( ; ; ) 
    {
        application_task( );
    }

    return 0;
}

static void display_error ( uint8_t *message )
{
    log_printf( &logger, " %s: ", message );
    if ( FINGERPRINT3_OK == error_check )
    {
        log_printf( &logger, "DONE!\r\n" );
    }
    else
    {
        log_printf( &logger, "FAIL! [ERROR] Num: 0x%.2X\r\n", ( uint16_t ) error_check );
    }
    log_printf( &logger, "--------------------------------- \r\n" );
}

static void display_full_rsp ( fingerprint3_t *ctx )
{
    log_printf( &logger, "* Header            : 0x%.4X\r\n", ctx->rsp.header );
    log_printf( &logger, "* Address           : 0x%.8LX\r\n", ctx->rsp.addr );
    log_printf( &logger, "* Package identifier: 0x%.2X\r\n", ( uint16_t ) ctx->rsp.pkg_id );
    log_printf( &logger, "* Package length    : 0x%.4X\r\n", ctx->rsp.pkg_len );

    log_printf( &logger, "* Confirmation code :" );

    if ( ctx->rsp.pkg_content[ 0 ] == FINGERPRINT3_CONF_CMD_OK )
    {
        log_printf( &logger, " OK!\r\n" );
    }
    else
    {
        log_error( &logger, " Num: 0x%.2X", ( uint16_t ) ctx->rsp.pkg_content[ 0 ] );
    }

    if ( ctx->rsp.pkg_len > 3 )
    {
        log_printf( &logger, "* Package Content: " );
        for ( uint16_t n_cnt = 1; n_cnt < ctx->rsp.pkg_len - 2; n_cnt++ )
        {

            log_printf( &logger, "0x%.2X ", ( uint16_t ) ctx->rsp.pkg_content[ n_cnt ] );
        }
        log_printf( &logger, "\r\n" );
    }

    log_printf( &logger, "* Checksum           : 0x%.4X \r\n", ctx->rsp.checksum );
}

static void search_finger( fingerprint3_t *ctx )
{
    log_printf( &logger, "  >>> Searching Fingerprints <<<  \r\n" );
    log_printf( &logger, "--------------------------------- \r\n" );
    fingerprint3_aura_control ( &fingerprint3, FINGERPRINT3_AURA_CTRL_BREATH, 0xFF, 
                                               FINGERPRINT3_AURA_LED_PURPLE, FINGERPRINT3_AURA_TIME_INFINITE );
    log_printf( &logger, " Put your finger on the sensor  \r\n" );
    log_printf( &logger, "--------------------------------- \r\n" );
    
    while ( fingerprint3_finger_indicator( &fingerprint3 ) == FINGERPRINT3_DETECT_NO_FINGER );
    
    while ( FINGERPRINT3_OK != fingerprint3_aura_control ( &fingerprint3, FINGERPRINT3_AURA_CTRL_OFF, 0xFF, 
                                                                          FINGERPRINT3_AURA_LED_PURPLE, 
                                                                          FINGERPRINT3_AURA_TIME_INFINITE ) )
    {
        Delay_ms ( 100 );
    }
    for ( ; ; )
    {
        error_check = fingerprint3_take_image ( &fingerprint3 );
        if ( FINGERPRINT3_OK != error_check )
        {
            display_error( "Take Image" );
            Delay_ms ( 1000 );
            continue;
        }
        error_check = fingerprint3_extract_features ( &fingerprint3, 1 );
        
        if ( FINGERPRINT3_OK != error_check )
        {
            display_error( "Extract Features" );
            Delay_ms ( 1000 );
            continue;
        }
        break;
    }
    
    uint16_t match_score, location;
    
    error_check = fingerprint3_search_finger ( &fingerprint3, 1, &location, &match_score );
    if ( FINGERPRINT3_OK == error_check )
    {
        log_printf( &logger, "  >>>>> FINGERPRINT MATCH <<<<<< \r\n\r\n" );
        log_printf( &logger, "  Location: 0x%.4X Match score : %u\r\n", location, match_score );
        log_printf( &logger, "---------------------------------\r\n" );
        fingerprint3_aura_control ( &fingerprint3, FINGERPRINT3_AURA_CTRL_BREATH, 0x80, 
                                                   FINGERPRINT3_AURA_LED_BLUE, 1 );
    }
    else if ( FINGERPRINT3_CONF_NOT_FOUND == error_check )
    {
        log_printf( &logger, " >>>>> NO MATCH in library <<<<<<\r\n\r\n" );
        log_printf( &logger, "---------------------------------\r\n" );
        fingerprint3_aura_control ( &fingerprint3, FINGERPRINT3_AURA_CTRL_BREATH, 0x80, 
                                                   FINGERPRINT3_AURA_LED_RED, 1 );
    }
    else
    {
        display_error( "Search Finger" );
        fingerprint3_aura_control ( &fingerprint3, FINGERPRINT3_AURA_CTRL_BREATH, 0x80, 
                                                   FINGERPRINT3_AURA_LED_RED, 1 );
    }
    Delay_ms ( 100 );
    log_printf( &logger, " Lift the finger of the sensor.\r\n" );
    log_printf( &logger, "--------------------------------- \r\n" );
            
    error_check = fingerprint3_take_image ( &fingerprint3 );
    while ( error_check != FINGERPRINT3_CONF_NO_FINGER )
    {
        Delay_ms ( 100 );
        error_check = fingerprint3_take_image ( &fingerprint3 );
    }
    while ( fingerprint3_finger_indicator( &fingerprint3 ) != FINGERPRINT3_DETECT_NO_FINGER );
    
    Delay_ms ( 1000 );
}

static void match_finger( fingerprint3_t *ctx, uint16_t location )
{
    error_check = fingerprint3_load_template ( &fingerprint3, 2, location );
    display_error( "Load Template" );
    Delay_ms ( 100 );
    
    log_printf( &logger, "  >>> Matching Fingerprints <<<  \r\n" );
    log_printf( &logger, "--------------------------------- \r\n" );
    fingerprint3_aura_control ( &fingerprint3, FINGERPRINT3_AURA_CTRL_BREATH, 0xFF, 
                                               FINGERPRINT3_AURA_LED_PURPLE, FINGERPRINT3_AURA_TIME_INFINITE );
    log_printf( &logger, " Put your finger on the sensor  \r\n" );
    log_printf( &logger, "--------------------------------- \r\n" );
    
    while ( fingerprint3_finger_indicator( &fingerprint3 ) == FINGERPRINT3_DETECT_NO_FINGER );
    
    while ( FINGERPRINT3_OK != fingerprint3_aura_control ( &fingerprint3, FINGERPRINT3_AURA_CTRL_OFF, 0xFF, 
                                                                          FINGERPRINT3_AURA_LED_PURPLE, 
                                                                          FINGERPRINT3_AURA_TIME_INFINITE ) )
    {
        Delay_ms ( 100 );
    }
    
    for ( ; ; )
    {
        error_check = fingerprint3_take_image ( &fingerprint3 );
        if ( FINGERPRINT3_OK != error_check )
        {
            display_error( "Take Image" );
            Delay_ms ( 1000 );
            continue;
        }
        error_check = fingerprint3_extract_features ( &fingerprint3, 3 );
        
        if ( FINGERPRINT3_OK != error_check )
        {
            display_error( "Extract Features" );
            Delay_ms ( 1000 );
            continue;
        }
        break;
    }
    
    uint16_t match_score;
    
    error_check = fingerprint3_match_finger ( &fingerprint3, &match_score );
    if ( FINGERPRINT3_OK == error_check )
    {
        log_printf( &logger, "  >>>>> FINGERPRINT MATCH <<<<<< \r\n\r\n" );
        log_printf( &logger, "  Match score       : %u\r\n", match_score );
        log_printf( &logger, "---------------------------------\r\n" );
        fingerprint3_aura_control ( &fingerprint3, FINGERPRINT3_AURA_CTRL_BREATH, 0x80, 
                                                   FINGERPRINT3_AURA_LED_BLUE, 1 );
    }
    else if ( FINGERPRINT3_CONF_NO_MATCH == error_check )
    {
        log_printf( &logger, " >>>>> NO MATCH at location: 0x%.4X <<<<<<\r\n\r\n", location );
        log_printf( &logger, "---------------------------------\r\n" );
        fingerprint3_aura_control ( &fingerprint3, FINGERPRINT3_AURA_CTRL_BREATH, 0x80, 
                                                   FINGERPRINT3_AURA_LED_RED, 1 );
    }
    else
    {
        display_error( "Match Finger" );
        fingerprint3_aura_control ( &fingerprint3, FINGERPRINT3_AURA_CTRL_BREATH, 0x80, 
                                                   FINGERPRINT3_AURA_LED_RED, 1 );
    }
    Delay_ms ( 100 );
    log_printf( &logger, " Lift the finger of the sensor.\r\n" );
    log_printf( &logger, "--------------------------------- \r\n" );
            
    error_check = fingerprint3_take_image ( &fingerprint3 );
    while ( error_check != FINGERPRINT3_CONF_NO_FINGER )
    {
        Delay_ms ( 100 );
        error_check = fingerprint3_take_image ( &fingerprint3 );
    }
    while ( fingerprint3_finger_indicator( &fingerprint3 ) != FINGERPRINT3_DETECT_NO_FINGER );
    
    Delay_ms ( 1000 );
}

static uint8_t enroll_finger( fingerprint3_t *ctx, uint16_t location, uint8_t features )
{
    for ( uint8_t cnt = 1; cnt <= features; )
    {
        log_printf( &logger, " >>>  Taking image %u of %u  <<<\r\n", ( uint16_t ) cnt, 
                                                                     ( uint16_t ) features );
        log_printf( &logger, "--------------------------------- \r\n" );

        log_printf( &logger, " Put your finger on the sensor  \r\n" );
        log_printf( &logger, "--------------------------------- \r\n" );
        fingerprint3_aura_control ( &fingerprint3, FINGERPRINT3_AURA_CTRL_BREATH, 0xFF, 
                                                   FINGERPRINT3_AURA_LED_PURPLE, FINGERPRINT3_AURA_TIME_INFINITE );

        while ( fingerprint3_finger_indicator( &fingerprint3 ) == FINGERPRINT3_DETECT_NO_FINGER );
        
        while ( FINGERPRINT3_OK != fingerprint3_aura_control ( &fingerprint3, FINGERPRINT3_AURA_CTRL_OFF, 0xFF, 
                                                                              FINGERPRINT3_AURA_LED_PURPLE, 
                                                                              FINGERPRINT3_AURA_TIME_INFINITE ) )
        {
            Delay_ms ( 100 );
        }

        error_check = fingerprint3_take_image ( &fingerprint3 );
        display_error( "Take Image" );
                
        if ( FINGERPRINT3_OK == error_check )
        {
            Delay_ms ( 100 );
            error_check = fingerprint3_extract_features ( &fingerprint3, cnt );
            display_error( "Extract Features" );
            if ( FINGERPRINT3_OK == error_check )
            {
                cnt++;
            }
            Delay_ms ( 100 );
            fingerprint3_aura_control ( &fingerprint3, FINGERPRINT3_AURA_CTRL_BREATH, 0x80, 
                                                       FINGERPRINT3_AURA_LED_BLUE, 1 );
            Delay_ms ( 100 );
            
        }

        log_printf( &logger, " Lift the finger of the sensor.\r\n" );
        log_printf( &logger, "--------------------------------- \r\n" );
        
        error_check = fingerprint3_take_image ( &fingerprint3 );
        while ( error_check != FINGERPRINT3_CONF_NO_FINGER )
        {
            Delay_ms ( 100 );
            error_check = fingerprint3_take_image ( &fingerprint3 );
        }
        while ( fingerprint3_finger_indicator( &fingerprint3 ) != FINGERPRINT3_DETECT_NO_FINGER );
        Delay_ms ( 100 );
    }
    error_check = fingerprint3_create_template ( &fingerprint3 );
    display_error( "Create Template" );
    if ( FINGERPRINT3_OK != error_check )
    {
        return error_check;
    }
    Delay_ms ( 100 );
    error_check = fingerprint3_store_template ( &fingerprint3, 1, location );
    display_error( "Store Template" );
    if ( FINGERPRINT3_OK != error_check )
    {
        return error_check;
    }
    Delay_ms ( 100 );
    
    return FINGERPRINT3_OK;
}

// ------------------------------------------------------------------------ END

Additional Support

Resources

Love this project?

'Buy This Kit' button takes you directly to the shopping cart where you can easily add or remove products.