新手入门
- 积分
- 14
- 金钱
- 14
- 注册时间
- 2019-12-18
- 在线时间
- 2 小时
|
楼主 |
发表于 2019-12-19 19:40:27
|
显示全部楼层
#include<reg52.h>
#include<intrins.h>
#include"buzz.h"
#include"key.h"
#include"uart.h"
#include"delay.h"
#include"FPM10A.h"
#include"lcd_1602.h"
unsigned char time = 0;
sbit PWM_MOTO = P2^0;
void Sevro_MOTO()
{
extern unsigned char timebuff;
if(time <= timebuff)
PWM_MOTO=1;
else
PWM_MOTO=0;
if(time >= 100)
time=0;
}
void main()
{
extern unsigned char timebuff;
LCD1602_Init(); //³õʼ»¯Òº¾§
LCD1602_Display(0x80,"Fingerprint Test",0,16); //Òº¾§¿ª»úÏÔʾ½çÃæ
Uart_Init(); //³õʼ»¯´®¿Ú
Key_Init(); //³õʼ»¯°´¼ü
Delay_Ms(200); //ÑÓʱ500MS£¬µÈ´ýÖ¸ÎÆÄ£¿é¸´Î»
Device_Check(); //У¶ÔÖ¸ÎÆÄ£¿éÊÇ·ñ½ÓÈëÕýÈ·£¬Òº¾§×ö³öÏàÓ¦µÄÌáʾ
Delay_Ms(1000); //¶Ô½Ó³É¹¦½çÃæÍ£ÁôÒ»¶¨Ê±¼ä
while(1)
{
/**************½øÈëÖ÷¹¦ÄܽçÃæ****************/
LCD1602_Display(0x80," search finger ",0,16); //µÚÒ»ÅÅÏÔʾËÑË÷Ö¸ÎÆ
LCD1602_Display(0xc0," Add delete",0,16); //Ìí¼ÓºÍɾ³ýÖ¸ÎÆ
LCD1602_Display(0x80," shuru mima",0,16); //Ìí¼ÓºÍɾ³ýÖ¸ÎÆ
if(local_date==0)
{
LCD1602_Display(0x80, " *",0,2);
LCD1602_Display(0xc0, " ",0,2);
LCD1602_Display(0xc0+8," ",0,2);
}
else if(local_date==1)
{
LCD1602_Display(0x80, " ",0,2);
LCD1602_Display(0xc0, " *",0,2);
LCD1602_Display(0xc0+8," ",0,2);
}
else if(local_date==2)
{
LCD1602_Display(0x80, " ",0,2);
LCD1602_Display(0xc0, " ",0,2);
LCD1602_Display(0xc0+8," *",0,2);
}
//È·Èϼü
if(KEY_OK == 0)
{
while(KEY_OK == 0);//µÈ´ýËÉ¿ª°´¼ü
switch(local_date)
{
case 0: //ËÑË÷Ö¸ÎÆ
FPM10A_Find_Fingerprint();
break;
case 1: //Ìí¼ÓÖ¸ÎÆ
FPM10A_Add_Fingerprint();
break;
case 2: //Çå¿ÕÖ¸ÎÆ
FPM10A_Delete_All_Fingerprint();
break;
}
}
//Çл»¼ü
if(KEY_DOWN == 0)
{
while(KEY_DOWN == 0); //µÈ´ýËÉ¿ª°´¼ü
if(local_date<=2)
{
local_date++;
if(local_date==3)
local_date=0;
}
}
Delay_Ms(100); //ÑÓʱÅжÏ100MS¼ì²âÒ»´Î
}
}
void Timer0Interrupt(void) interrupt 1
{
TH0 = 0x0FF;
TL0 = 0x38;
time++;
Sevro_MOTO();
}
这是主程序 需要在哪里添加矩阵程序来实现添加指纹的 时候必须输入密码 |
|