蓝牙密码锁系统设计(24C02-1602)-电路方案

VIP专享 2021-04-20 09:37:19 277KB ZIP
9
收藏 收藏
举报

//包含头文件 #include #include //宏定义 #define LCM_Data P0 //将P0口定义为LCM_Data #define uchar unsigned char #define uint unsigned int #define w 6 //定义密码位数 //1602的控制脚 sbit lcd1602_rs=P2^7; sbit lcd1602_rw=P2^6; sbit lcd1602_en=P2^5; sbit Scl=P3^4; //24C02串行时钟 sbit Sda=P3^5; //24C02串行数据 sbit ALAM = P2^1; //报警 sbit KEY = P3^6; //开锁 bit operation=0; //操作标志位 bit pass=0; //密码正确标志 bit ReInputEn=0; //重置输入允许标志 bit s3_keydown=0; //3秒按键标志位 bit key_disable=0; //锁定键盘标志 bit flag_REC =0; //串口接受标志位 unsigned char buff[5]=0; unsigned char countt0,second; //t0中断计数器,秒计数器 void Delay5Ms(void); //声明延时函数 unsigned char code a[]={0xFE,0xFD,0xFB,0xF7}; //控盘扫描控制表 //液晶显示数据数组 unsigned char code start_line[] = {"password: "}; unsigned char code name[] = { "===Coded Lock==="}; //显示名称 unsigned char code Correct[] = {" correct "}; //输入正确 unsigned char code Error[] = {" error "}; //输入错误 unsigned char code codepass[] = {" pass "}; unsigned char code LockOpen[] = {" open "}; //OPEN unsigned char code SetNew[] = {"SetNewWordEnable"}; unsigned char code Input[] = {"input: "}; //INPUT unsigned char code ResetOK[] = {"ResetPasswordOK "}; unsigned char code initword[] = {"Init password..."}; unsigned char code Er_try[] = {"error,try again!"}; unsigned char code again[] = {"input again "}; unsigned char InputData[16]; //输入密码暂存区 unsigned char CurrentPassword[16]={1,3,1,4,2,0}; //管理员密码(只可在程序中修改) unsigned c

...展开详情
立即下载 身份认证VIP会员低至7折
一个资源只可评论一次,评论内容不能少于5个字
您会向同学/朋友/同事推荐我们的CSDN下载吗?
谢谢参与!您的真实评价是我们改进的动力~
  • 至尊王者

关注 私信
上传资源赚钱or赚积分
最新推荐
蓝牙密码锁系统设计(24C02-1602)-电路方案 (VIP专享) VIP下载
1/0