欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標題:
1602字符液晶自動水平和垂直滾動演示程序加仿真
[打印本頁]
作者:
panpanpan
時間:
2017-11-27 21:27
標題:
1602字符液晶自動水平和垂直滾動演示程序加仿真
在單片機的控制下能實現自動水平滾動與自動垂直滾動,并且帶有暫停開始按鈕
仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)
0.png
(19.18 KB, 下載次數: 44)
下載附件
2017-11-28 01:09 上傳
0.png
(42.33 KB, 下載次數: 50)
下載附件
2017-11-28 01:09 上傳
單片機源程序如下:
/*************** 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;
……………………
…………限于本文篇幅 余下代碼請從51黑下載附件…………
復制代碼
所有資料51hei提供下載:
60 1602字符液晶滾動演示程序.zip
(63.09 KB, 下載次數: 33)
2017-11-27 21:27 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
作者:
15160308129
時間:
2019-5-4 19:02
很好,解決了我很大問題
歡迎光臨 (http://www.raoushi.com/bbs/)
Powered by Discuz! X3.1