📄 password.c
字号:
/*#include <reg52.h>
#include <ctype.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <intrins.h>
#include "function.h"
#include "val.h"
unsigned char password_set[4],password[4];
extern bit up_bit,down_bit,enter_bit;
bit pass_bit;
extern bit master_bit,clr_bit,dis_pass_bit;
extern bit speed_set_bit;
extern unsigned char set_password;
void display_password(void)
{
unsigned char a[3],b[3];
bit k,l,m,n;
//第一行
display_line(0,0,&(master_one));//第二行
display_l_word(2,0,mi_code);
// display_l_word(2,16,dao_code);
// display_l_word(2,32,she_code);
display_l_word(2,48,ma_code);
// display_r_word(2,48,mm_code);
if(set_password==1) {
flash_r_byte(2,0,maohao_code);
if(down_bit){
down_bit=0;
set_password=6;}
a[0]=password[0];
a[1]=password[1];
a[2]=password[2];
a[3]=password[3];}
else display_r_byte(2,0,maohao_code);
if(set_password==2) {
flash_r_byte(2,16,&(number_code[a[0]*16]));
if(up_bit&&(a[0]<9)) {
up_bit=0;
a[0]=a[0]+1;}
if(down_bit&&(b[0]>0)) {
down_bit=0;
a[0]=a[0]-1;}
if(enter_bit) {
enter_bit=0;
password[0]=a[0];
set_password=3;}
}
else display_r_byte(2,16,&(number_code[password[0]*16]));
if(set_password==3) {
flash_r_byte(2,24,&(number_code[a[1]*16]));
if(up_bit&&(a[1]<9)) {
up_bit=0;
a[1]=a[1]+1;}
if(down_bit&&(a[1]>0)) {
down_bit=0;
a[1]=a[1]-1;}
if(enter_bit) {
enter_bit=0;
password[1]=a[1];
set_password=4;}
}
else display_r_byte(2,24,&(number_code[password[1]*16]));
if(set_password==4) {
flash_r_byte(2,32,&(number_code[a[2]*16]));
if(up_bit&&(a[2]<9)) {
up_bit=0;
a[2]=a[2]+1;}
if(down_bit&&(a[2]>0)) {
down_bit=0;
a[2]=a[2]-1;}
if(enter_bit) {
enter_bit=0;
password[2]=a[2];
set_password=5;}
}
else display_r_byte(2,32,&(number_code[password[2]*16]));
if(set_password==5) {
flash_r_byte(2,40,&(number_code[a[3]*16]));
if(up_bit&&(a[3]<9)) {
up_bit=0;
a[3]=a[3]+1;}
if(down_bit&&(a[2]>0)) {
down_bit=0;
a[3]=a[3]-1;}
if(enter_bit) {
enter_bit=0;
password[3]=a[3];
if((password[0]==0)&&(password[1]==0)&&(password[2]=0)&&(password[3]=0)){
password_set[0]=0;
password_set[1]=0;
password_set[2]=0;
password_set[3]=0;
set_password=6;}
if(password[0]==password_set[0]) k=1;
if(password[1]==password_set[1]) l=1;
if(password[2]==password_set[2]) m=1;
if(password[3]==password_set[3]) n=1;
if(k==1&&l==1&&m==1&&n==1){
k=0;
l=0;
m=0;
n=0;
pass_bit=1;
password[0]=0;
password[1]=0;
password[2]=0;
password[3]=0;
dis_pass_bit=0;
set_password=0;
clr_bit=1;
speed_set_bit=1;}
else {
k=0;
l=0;
m=0;
n=0;
pass_bit=0;
password[0]=0;
password[1]=0;
password[2]=0;
password[3]=0;
dis_pass_bit=0;
set_password=0;
clr_bit=1;
master_bit=1;}
}
}
else display_r_byte(2,40,&(number_code[password[3]*16]));
//第三行
display_l_word(4,0,she_code);
display_l_word(4,16,zhi_code);
display_l_word(4,32,mi_code);
display_l_word(4,48,ma_code);
// display_r_word(2,48,mm_code);
if((password_set[0]==0)&&(password_set[1]==0)&&(password_set[2]=0)&&(password_set[3]=0)){
if(set_password==6) {
flash_r_byte(4,0,maohao_code);
if(up_bit){
up_bit=0;
set_password=1;}
b[0]=password_set[0];
b[1]=password_set[1];
b[2]=password_set[2];
b[3]=password_set[3];}
else display_r_byte(4,0,maohao_code);
if(set_password==7) {
flash_r_byte(4,16,&(number_code[b[0]*16]));
if(up_bit&&(b[0]<9)) {
up_bit=0;
b[0]=b[0]+1;}
if(down_bit&&(b[0]>0)) {
down_bit=0;
b[0]=b[0]-1;}
if(enter_bit) {
enter_bit=0;
password_set[0]=b[0];
set_password=8;}
}
else display_r_byte(4,16,&(number_code[8*16]));
if(set_password==8) {
flash_r_byte(4,24,&(number_code[b[1]*16]));
if(up_bit&&(b[1]<9)) {
up_bit=0;
b[1]=b[1]+1;}
if(down_bit&&(b[1]>0)) {
down_bit=0;
b[1]=b[1]-1;}
if(enter_bit) {
enter_bit=0;
password_set[1]=b[1];
set_password=9;}
}
else display_r_byte(4,24,&(number_code[8*16]));
if(set_password==9) {
flash_r_byte(4,32,&(number_code[b[2]*16]));
if(up_bit&&(b[2]<9)) {
up_bit=0;
b[2]=b[2]+1;}
if(down_bit&&(b[2]>0)) {
down_bit=0;
b[2]=b[2]-1;}
if(enter_bit) {
enter_bit=0;
password_set[2]=b[2];
set_password=10;}
}
else display_r_byte(4,32,&(number_code[8*16]));
if(set_password==10) {
flash_r_byte(4,40,&(number_code[b[3]*16]));
if(up_bit&&(b[3]<9)) {
up_bit=0;
b[3]=b[3]+1;}
if(down_bit&&(b[2]>0)) {
down_bit=0;
b[3]=b[3]-1;}
if(enter_bit) {
enter_bit=0;
password_set[3]=b[3];
set_password=11;}
}
else display_r_byte(4,40,&(number_code[8*16]));
}
}*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -