This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

a fingerprint verification program

i want a fingerprint based User Verification Program with It's header file inclusion in Embedded C.
help !

thanks!

Parents
  • Okay Guys..here I have the header files used in that program ,take a look !

    [1] LCD.h File

    #include<reg52.h>

    /*LCD CONNECTION*/
    #define lcd P2

    sbit rs=P0^1;
    sbit rw=P0^2;
    sbit en=P0^3;

    /*LCD FUNCTIONS DECLARATION*/
    void lcd_init(void);
    void cmd(unsigned char);
    void disp(unsigned char);
    void str(unsigned char *);
    void delay(unsigned int);

    /*LCD INITIALIZATION FUNCTION*/
    void lcd_init(void)
    { cmd(0x38); //INITIALIZE LCD AS 2 LINE & 5X7 MATRIX (8-BIT MODE) cmd(0x0e); //DISPLAY 'ON' CURSOR BLINKING cmd(0x01); //CLEAR DISPLAY SCREEN cmd(0x06); //SHIFT CURSOR TO RIGHT cmd(0x08); //DISPLAY 'OFF' CURSOR 'OFF'
    } void cmd(unsigned char c)
    { lcd=c; rs=0; rw=0; en=1; delay(2); en=0;
    }

    void disp(unsigned char ch)
    { lcd=ch; rs=1; rw=0; en=1; delay(2); en=0;
    }

    void str(unsigned char *s)
    { while(*s) disp(*s++);
    }

    void delay(unsigned int k)
    { unsigned int i,j; for(i=0;i<k;i++) for(j=0;j<1275;j++);
    }

    [2] SERIAL.h Files

    (Ok, here are 2 file of that, u can use any of them i' selected 2nd one.)

    ......./I/.......

    #include<reg52.h>

    /* FUNCTION & BIT INTIALIZATION */
    void uart_init(void)
    { SCON=0x50; TMOD=0X20; TH1=TL1=-3; TR1=1;
    }

    /* FOR WRITING DATA TO LCD DISPLAY */
    void tx(unsigned char ch)
    { SBUF=ch; while(TI==0) TI=0;
    }

    /* FOR RECEIVING ANY DATA*/
    unsigned char rx(void)
    { while(RI==0) RI=0; return SBUF;
    }

    main()
    { unsigned char c; uart_init(); while(1) { c=rx; tx(c); }
    } "OR"

    ......./II/.......

    /* Transmit only */
    #include<reg52.h>

    /**VARIABLES DECLARATION**/
    bit flag;
    bit r_flag = 0;
    int i=0;
    char idata buff[20],ch;

    /**INTERRUPT SERVICE ROUTINE**/
    void serial_intr(void) interrupt 4
    { if(TI == 1) { TI = 0; flag = 1; } else if(RI==1) { ch=SBUF; if((ch!='\r') && (ch!='\n')) buff[i++]=ch; else buff[i++]='\0'; if(ch=='\n') { r_flag=1; i=0; } RI=0;

    }

    }

    /**TRANSMISSION FUNCTION**/
    void print(char *str)
    { while(*str) { flag = 0; SBUF = *str++; while(flag == 0); }

    }

Reply
  • Okay Guys..here I have the header files used in that program ,take a look !

    [1] LCD.h File

    #include<reg52.h>

    /*LCD CONNECTION*/
    #define lcd P2

    sbit rs=P0^1;
    sbit rw=P0^2;
    sbit en=P0^3;

    /*LCD FUNCTIONS DECLARATION*/
    void lcd_init(void);
    void cmd(unsigned char);
    void disp(unsigned char);
    void str(unsigned char *);
    void delay(unsigned int);

    /*LCD INITIALIZATION FUNCTION*/
    void lcd_init(void)
    { cmd(0x38); //INITIALIZE LCD AS 2 LINE & 5X7 MATRIX (8-BIT MODE) cmd(0x0e); //DISPLAY 'ON' CURSOR BLINKING cmd(0x01); //CLEAR DISPLAY SCREEN cmd(0x06); //SHIFT CURSOR TO RIGHT cmd(0x08); //DISPLAY 'OFF' CURSOR 'OFF'
    } void cmd(unsigned char c)
    { lcd=c; rs=0; rw=0; en=1; delay(2); en=0;
    }

    void disp(unsigned char ch)
    { lcd=ch; rs=1; rw=0; en=1; delay(2); en=0;
    }

    void str(unsigned char *s)
    { while(*s) disp(*s++);
    }

    void delay(unsigned int k)
    { unsigned int i,j; for(i=0;i<k;i++) for(j=0;j<1275;j++);
    }

    [2] SERIAL.h Files

    (Ok, here are 2 file of that, u can use any of them i' selected 2nd one.)

    ......./I/.......

    #include<reg52.h>

    /* FUNCTION & BIT INTIALIZATION */
    void uart_init(void)
    { SCON=0x50; TMOD=0X20; TH1=TL1=-3; TR1=1;
    }

    /* FOR WRITING DATA TO LCD DISPLAY */
    void tx(unsigned char ch)
    { SBUF=ch; while(TI==0) TI=0;
    }

    /* FOR RECEIVING ANY DATA*/
    unsigned char rx(void)
    { while(RI==0) RI=0; return SBUF;
    }

    main()
    { unsigned char c; uart_init(); while(1) { c=rx; tx(c); }
    } "OR"

    ......./II/.......

    /* Transmit only */
    #include<reg52.h>

    /**VARIABLES DECLARATION**/
    bit flag;
    bit r_flag = 0;
    int i=0;
    char idata buff[20],ch;

    /**INTERRUPT SERVICE ROUTINE**/
    void serial_intr(void) interrupt 4
    { if(TI == 1) { TI = 0; flag = 1; } else if(RI==1) { ch=SBUF; if((ch!='\r') && (ch!='\n')) buff[i++]=ch; else buff[i++]='\0'; if(ch=='\n') { r_flag=1; i=0; } RI=0;

    }

    }

    /**TRANSMISSION FUNCTION**/
    void print(char *str)
    { while(*str) { flag = 0; SBUF = *str++; while(flag == 0); }

    }

Children
No data