基于单片机指纹密码锁系统仿真设计-protues毕设课设

百度网盘下载地址(1120):点击下载

#include <reg52.h>
#include "1602.h"
#include <stdio.h>
#include "KEY4X4.h"
#include "eeprom2.h"
static bit	flag;                   /* 定义刷新标志 */
volatile uchar	Key_Value = 0xff;
uint		count;                  /* 定义计数标志 */
uchar		input_state = 0;        /* 输入状态 0显示时间 1输入密码 2指纹录入 */

extern void DS1302Init();


extern void read_time( uchar curr_time[] );


extern void set_time( uchar *pSecDa );


/*typedef struct Timer{
 * uchar year;
 * uchar month;
 * uchar day;
 * uchar hour;
 * uchar min;
 * }Timer;
 * Timer Timer_now;*/
uchar	getTimebuf[7]; /* 存放时间数据 */
uchar	position_input = 0;
uchar	key_buf[6];
uchar	password[6];

uchar	mode;
char	shwobuf[15] = "";

#define CHK_PASSWORD (password[0] == key_buf[0]) && (password[1] == key_buf[1]) && (password[2] == key_buf[2]) && (password[3] == key_buf[3]) && (password[4] == key_buf[4]) && (password[5] == key_buf[5])

void Timer0Init()               /* 定时计0数器初始化 */
{
	TMOD	= 0x01;
	TH0	= 0xf8;         /* 2ms定时 */
	TL0	= 0x30;
	ET0	= 1;
	TR0	= 1;
	EA	= 1;
	flag	= 1;            /* 定时1秒标志 */
}

posted @ 2021-02-22 09:55  roadroad  阅读(279)  评论(0编辑  收藏  举报
电设屋
上千套电子毕设课设方案