4位密码锁java_基于单片机的电子密码锁的实现

/*****************************键盘码的顺序**********************************/

/*                        0xee,0xde,0xbe,0x7e    0-3                     */

/*                        0xed,0xdd,0xbd,0x7d    4-7                     */

/*                        0xeb,0xdb,0xbb,0x7b    8-b                     */

/*                        0xe7,0xd7,0xb7,0x77    c-f                     */

/*                  密码输入0-d;e,f 作为保留,f暂时用作确认                 */

/*                  连线:P0接键盘, P2接数码管(p2.7接H)                    */

/*************************************************************************/

#include

#define uchar unsigned char

#define uint  unsigned int

sbit P30=P3^0;

uint a;

uint fre;//控制频率

uint flag;

uint time=0;  //控制中断时间

uchar count=0;//控制多少秒

uint t;

uint ff=0; //判断是否验证成功

uint fff=3;//判断用户输入次数

uint kaiguan=0;//判断电机是否开关的

/***********************步进电机****************************/

void delay(unsigned int t);

unsigned char code RUN[8]={0xf1,0xf3,0xf2,0xf6,0xf4,0xfc,0xf8,0xf9};  //步进电机相序表

//步进电机驱动

void  motor_ffw()

{

if(kaiguan==1)

{

unsigned char i;

for (i=0; i<8; i++)       //一个周期转3.75*8=30度

{

P1 = RUN[i]&0x1f;     //取数据

delay(15);             //调节转速

}

}

}

/***********************************************************/

//八段管显示码

code unsigned char LEDMAP[]={

~0x3f, ~0x06, ~0x5b, ~0x4f, ~0x66, ~0x6d, ~0x7d, ~0x07,

~0x7f, ~0x6f, ~0x77, ~0x7c, ~0x39, ~0x5e, ~0x79, ~0x71

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
目 录 摘要..........................................(03) 关键字........................................(03) 1 前言..........................................(04) 2 系统设计......................................(04) 2.1 电子密码锁的工作原理......................(04) 2.2 系统硬件组成..............................(04) 2.3 矩阵键盘扫面工作原理......................(05) 2.4 LED数码管动态显示原理.....................(05) 2.5 电子密码锁系统硬件设计..... ..............(06) 2.6 电子密码锁系统软件设计....... ............(07) 3 设计体会与结论................................(07) 4附录...........................................(08) 5参考文献.......................................(13) 摘要 电子密码锁是一种通过密码输入来控制电路或是芯片工作,从而控制机械开关的闭合,完成开锁、闭锁任务的电子产品。它的种类很多,有简易的电路产品,也有基于芯片的性价比较高的产品。现在应用较广的电子密码锁是以芯片为核心,通过编程来实现的。其性能和安全性已大大超过了机械锁,特点如下: 1.保密性好,编码量多,远远大于弹子锁。随机开锁成功率几乎为零。 2.密码可变。 用户可以经常更改密码,防止密码被盗,同时也可以避免因人员的更替而使锁的密级下降。 3.误码输入保护。当输入密码多次错误时,报警系统自动启动。 4. 电子密码锁操作简单易行,一学即会。 关键字;单片机 LED数码管 矩阵键盘 密码锁 Abstract Electronic Code Lock is a password input through the control circuit, or chip, thus controlling the closed mechanical switch to complete the lock, closed the task of electronic products. It is of many types, have a simple circuit products, but also the higher cost chip-based products. Now the widely used electronic code lock is a chip at the core, achieved through programming. Performance and safety have greatly exceeded the mechanical lock, the following features: 1. Privacy is good, coding quantity is far greater than the spring lock. Random unlocking success rate is almost zero. 2. Password variable. Users can always change the password, to prevent password theft, but also avoids the lock because of staff turnover Er Shi and drawing down. 3. Error input protection. When you enter your password wrong several times, the alarm system started automatically. 4. E-lock operation is simple, a school that will. Keywords; MCU LED digital tube matrix keypad lock 1 前言 随着人们生活水平的提高,如何实现家庭防盗这一问题也变的尤其的突出,传统的机械锁由于其构造的简单,被撬的事件屡见不鲜,电子锁由于其保密性高,使用灵活性好,安全系数高,受到了广大

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值