‘
#include <reg52.h>
#include "delay_ms.h"
#include "矩阵键盘.h"
#include "i2c.h"
#include "1602.h"
#include "delay_ms.h"
#include "mima.h"
#define uchar unsigned char
#define uint unsigned int
#define A 0x0a /* 输入密码 */
#define B 0x0b /* 修改密码 */
#define D 0x0d /* 关锁 */
#define enter 0x0c /* 确认 */
#define backspace 0x0f /* 退格键 */
sbit baojing = P3 ^ 7; /* 蜂鸣器接口 */
sbit lock = P3 ^ 3; /* 锁信号 */
sbit set = P3 ^ 2;
sbit men = P2 ^ 0;
sbit led = P2 ^ 1;
uchar idata mima_5[6] = { 1, 2, 3, 4, 5, 6 }; /* 初始密码 */
uchar flag_change;
uchar aa; /* 存放密码错误的次数,够三次报警 */
uchar bb;
uchar flag_t0;
void baoj1() /* 报警函数 */
{
int i;
for ( i = 0; i < 5; i++ )
{
baojing = 1;