#include<reg52.h>
#include<touwenjian.h>
#include <absacc.h>
#include<shuzi.h>
#define nop() _nop_()
uchar unm1,shu13;
uchar folly,folly1,folly2=0;
uchar rest,rest1,rest2=0;
uchar password3[6],password4[6];
uchar repassword[18];
uchar shu[]="*";
void in_star(uchar foy);
void in_password();
uchar matrixkeyscan();
void Pass_word();
void xianshi(uchar unm1);
void mistakee();
void meun2();
void meun();
void reset();
void in_star1(uchar foy);
void in_star(uchar foy);
bit comparison1();
bit comparison();
void delayms(uint i)
{
while(i--);
}
void LCD_Initial(void)
{
LCD_CmdWrite(WLCR); //[00H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(MISC); //[01H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(ADSR); //[03H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(INTR); //[0FH] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(WCCR); //[10H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(CHWI); //[11H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(MAMR); //[12H] , Default --> 0x11
LCD_DataWrite(0x11);
LCD_CmdWrite(AWRR); //[20H] , Default --> 0x27
LCD_DataWrite(0x27);
LCD_CmdWrite(DWWR); //[21H] , Default --> 0x27
LCD_DataWrite(0x27);
LCD_CmdWrite(AWBR); //[30H] , Default --> 0xEF
LCD_DataWrite(0xef);
LCD_CmdWrite(DWHR); //[31H] , Default --> 0xEF
LCD_DataWrite(0xef);
LCD_CmdWrite(AWLR); //[40H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(AWTR); //[50H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(CURX); //[60H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(BGSG); //[61H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(EDSG); //[62H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(CURY); //[70H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(BGCM); //[71H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(EDCM); //[72H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(BTMR); //[80H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(ITCR); //[90H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(KSCR1); //[A0H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(KSCR2); //[A1H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(KSDR0); //[A2H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(KSDR1); //[A3H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(KSDR2); //[A3H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(PCR); //[D0H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(PDCR); //[D1H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(PNTR); //[E0H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(FNCR); //[F0H] , Default --> 0x00
LCD_DataWrite(0x00);
LCD_CmdWrite(FVHT); //[F1H] , Default --> 0x00
LCD_DataWrite(0x00);
}
void windows()
{
uchar i;
LCD_Initial();
LCD_ON();
LCD_Clear();
LCD_Text(); //写文字
LCD_CmdWrite(0xf1); //调整字体的大小
LCD_DataWrite(0x12);
LCD_NoBold();
LCD_NoInv();
LCD_LineDist_Adjust(7);
LCD_GotoXY(2,87);
LCD_CmdWrite(0xb0);
LCD_GotoXY(0,30); //坐标
LCD_CmdWrite(0xb0);
for(i=0;i<40;i++)
{
LCD_DataWrite(sRAiO17[i]); //写的是“伊思腾电子科技有限公司—www.yisiteng.com”
do{
Delay2us(20);
}while(LCD_CmdRead() & 0x80);
}
LCD_Text(); //写文字
LCD_CmdWrite(0xf1); //调整字体的大小 0xf1的5、6位是调整垂直方向的放大倍数,7、8位是水平方向的大小
LCD_DataWrite(0x50); // 垂直、水平都放大了一倍。
LCD_NoBold();
LCD_NoInv();
LCD_LineDist_Adjust(7);
LCD_GotoXY(2,87);
LCD_CmdWrite(0xb0);
for(i=0;i<15;i++)
{
LCD_DataWrite(sRAiO18[i]);
do{
Delay2us(2);
}while(LCD_CmdRead() & 0x80);
}
LCD_GotoXY(2,145);
LCD_CmdWrite(0xb0);
for(i=0;i<15;i++)
{
LCD_DataWrite(aRAi0181[i]);
do{
Delay2us(2);
}while(LCD_CmdRead() & 0x80);
}
bRST=0;
}
/*************************************************开机密码结束**********/
void main(void)
{
extern uchar Key_Code1, Key_Code2, Key_Code3, Key_Num;
// uchar key;
uchar unm,num;
int i;
uchar Debounce_count = 0;
unm1=17;
// folly2=0;
// flog=0;
P0 = 0xff;
P1 = 0xff;
P2 = 0xff;
P3 = 0xff;
/*P4M0=0x00;
P4M1=0x00; */
// P4SW=0xff;
AUXR = 0x03; //Enable MOVX for external interface
LCD_Reset();
LCD_Initial();
LCD_CmdWrite(BTMR);
LCD_DataWrite(0x20);
LCD_CmdWrite(ITCR);
LCD_DataWrite(255);
LCD_ON();
LCD_Clear();
/**********************************伊思腾商标显示************/
Access_Page1();
Only_Show_Page1();
LCD_Graphic();
LCD_GotoXY(0,5);
LCD_CmdWrite(0xb0);
for(i=0;i<9600;i++)
LCD_DataWrite(Demo_Top_Headline[i]);
bRST=0;
Delay100ms(10);
Delay10ms(10);
/*******************************伊思腾商标显示结束*******************/
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@伊思腾文字显示@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
windows();
// Pass_word();
while(1)
{
shu: num=matrixkeyscan();
if(num!=unm)
{
unm=num;
// xianshi();
if(unm==11)
{
Pass_word();
in_password();
}
else
goto shu;
// break;
}
}
}
void Pass_word()
{
uchar i;
LCD_Initial();
LCD_ON();
LCD_Clear();
LCD_Text(); //写文字
LCD_CmdWrite(0xf1); //调整字体的大小
LCD_DataWrite(0x12);
LCD_NoBold();
LCD_NoInv();
LCD_LineDist_Adjust(7);
LCD_GotoXY(2,87);
LCD_CmdWrite(0xb0);
LCD_GotoXY(0,30); //坐标
LCD_CmdWrite(0xb0);
for(i=0;i<40;i++)
{
LCD_DataWrite(sRAiO17[i]); //写的是“伊思腾电子科技有限公司—www.yisiteng.com”
do{
Delay2us(20);
}while(LCD_CmdRead() & 0x80);
}
LCD_Text(); //写文字
LCD_CmdWrite(0xf1); //调整字体的大小 0xf1的5、6位是调整垂直方向的放大倍数,7、8位是水平方向的大小
LCD_DataWrite(0x50); // 垂直、水平都放大了一倍。
LCD_NoBold();
LCD_NoInv();
LCD_LineDist_Adjust(7);
LCD_GotoXY(2,87);
LCD_CmdWrite(0xb0);
for(i=0;i<15;i++)
{
LCD_DataWrite(password1[i]);
do{
Delay2us(2);
}while(LCD_CmdRead() & 0x80); ////输入“密码"”
}
LCD_GotoXY(8,145);
LCD_CmdWrite(0xb0);
for(i=0;i<0;i++)
{
LCD_DataWrite(password2[i]); //输入密码是数值
do{
Delay2us(2);
}while(LCD_CmdRead() & 0x80);
}
LCD_CmdWrite(WCCR);
LCD_DataWrite(0);
/*****************光标闪动*****************/
LCD_CmdWrite(WCCR);
LCD_DataWrite(0x06);
LCD_CmdWrite(CHWI);
LCD_DataWrite(0x01);
LCD_CmdWrite(BTMR);
LCD_DataWrite(0x20);
bRST=0;
}
uchar matrixkeyscan()
{
uchar temp;
uchar flog;
BUTTON=0xfe;
nop();
nop();
temp=BUTTON;
temp=temp&0xf8;
if(temp!=0xf8)
{
delayms(4);
temp=BUTTON;
temp=temp&0xf8;
if(temp!=0xf8)
{
temp=BUTTON;
switch(temp)
{
/* case 0xde:
flog=0;
break; */
case 0xee: //4
flog=4;
break;
case 0xf6: //6
flog=6;
break;
/* case 0xfa:
flog=3;
break;
case 0xfc:
flog=4;
break; */
}
}
}
BUTTON=0xf7;
nop();
nop();
temp=BUTTON;
temp=temp&0xf0;
if(temp!=0xf0)
{
delayms(4);
temp=BUTTON;
temp=temp&0xf0;
if(temp!=0xf0)
{
temp=BUTTON;
switch(temp)
{
case 0xd7: //e
320240液晶程序源代码
4星 · 超过85%的资源 需积分: 9 14 浏览量
2010-06-04
14:23:42
上传
评论 2
收藏 80KB RAR 举报
Aegean_love
- 粉丝: 0
- 资源: 5
最新资源
- WS2-32.lib,在编译程序中可以链接使用
- 秒懂傅里叶变换matlab程序实现过程
- ZEND解密dezender12
- sony 索尼IMX334摄像头模组电路板AD版硬件PCB图(6层板).zip
- 基于flask和echarts融合交易策略的bitfinex可视化微服务.zip
- 包含了wvp-assist.tar wvp-talk.tar zlmediakit.tar .
- 3r4efgh53wgrf43tw
- 2024新版Java基础从入门到精通全套视频+资料下载
- Spring AI大模型视频教程+ChatGPT视频教程+OpenAI大模型视频教程(资料+视频教程)
- ABB工业机器人教程PDF版本
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈