/*************** writer:shopping.w ******************/
#include <reg52.h>
#include <string.h>
#define uchar unsigned char
#define uint unsigned int
void Initialize_LCD();
void ShowString(uchar,uchar,uchar *);
sbit K1 = P3^0;
sbit K2 = P3^1;
sbit K3 = P3^2;
uchar code Prompt[]="PRESS K1--K4 TO START DEMO PROG";
uchar const Line_Count = 6;
uchar code Msg[][80]=
{
"Many CAD users dismiss",
"process of creating PCB",
"of view.with PCB layout",
"placement and track routing,",
"can often be the most time",
"And if you use circuit simulation",
"you are going to spend even more"
};
uchar Disp_Buffer[32];
void Delayxms(uint ms)
{
uchar i;
while(ms--)
{
for(i=0;i<120;i++);
}
}
void V_Scroll_Display()
{
uchar i,j,k = 0;
uchar *p = Msg[0];
uchar *q = Msg[Line_Count] + strlen(Msg[Line_Count]);
while(p<q)
{
for(i=0;(i<16)&&(p<q);i++)
{
if(((i==0)||(i==15))&& *p == ' ')
p++;
if(*p != '\0')
{
Disp_Buffer[i] = *p++;
}
else
{
if(++k>Line_Count)
break;
p = Msg[k];
Disp_Buffer[i] = *p++;
}
}
for(j=i;j<16;j++)
Disp_Buffer[j]=' ';
while(F0)
Delayxms(5);
ShowString(0,0," ");
Delayxms(150);
while(F0)
Delayxms(5);
ShowString(0,1,Disp_Buffer);
Delayxms(150);
while(F0)
Delayxms(5);
ShowString(0,0,Disp_Buffer);
ShowString(0,1," ");
Delayxms(150);
}
ShowString(0,0," ");
ShowString(0,1," ");
}
void H_Scroll_Display()
{
uchar m,n,t = 0,L=0;
uchar *p = Msg[0];
uchar *q = Msg[Line_Count] + strlen(Msg[Line_Count]);
for(m=0;m<16;m++)
Disp_Buffer[m]=' ';
while(p<q)
{
if((m=16||m==31)&& *p == ' ')
p++;
for(m=16;m<32&&p<q;m++)
{
if(*p != '\0')
{
Disp_Buffer[m] = *p++;
}
else
{
if(++t>Line_Count)
break;
p = Msg[t];
Disp_Buffer[m] = *p++;
}
}
for(n=m;n<32;n++)
Disp_Buffer[n]=' ';
for(m=0;m<=16;m++)
{
while(F0)
Delayxms(5);
ShowString(0,L,Disp_Buffer+1);
while(F0)
Delayxms(5);
Delayxms(20);
}
L = (L==0)? 1:0;
Delayxms(200);
}
if(L==1)
ShowString(0,1," ");
}
void EX_INT0() interrupt 0
{
F0 = !F0;
}
void main()
{
uint Count = 0;
IE = 0x81;
IT0 = 1;
F0 = 0;
Initialize_LCD();
ShowString(0,0,Prompt);
ShowString(0,1,Prompt+16);
while(1)
{
if(K1 == 0)
{
V_Scroll_Display();
Delayxms(200);
}
else if(K2 == 0)
{
H_Scroll_Display();
Delayxms(200);
}
}
}
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![py](https://img-home.csdnimg.cn/images/20210720083646.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
收起资源包目录
![package](https://csdnimg.cn/release/downloadcmsfe/public/img/package.f3fc750b.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/RAR.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![folder](https://csdnimg.cn/release/downloadcmsfe/public/img/folder.005fa2e5.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
![file-type](https://csdnimg.cn/release/download/static_files/pc/images/minetype/UNKNOWN.png)
共 22 条
- 1
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
![avatar](https://profile-avatar.csdnimg.cn/398cd0506035400f9a115ab39b612698_weixin_44378594.jpg!1)
达西西66
- 粉丝: 1211
- 资源: 550
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)