<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>

新聞中心

EEPW首頁(yè) > 嵌入式系統 > 設計應用 > 1602液晶操作方法及代碼

1602液晶操作方法及代碼

作者: 時(shí)間:2016-12-01 來(lái)源:網(wǎng)絡(luò ) 收藏

CODE:
#include
#define uint unsigned int
#define uchar unsigned char
sbit lcdwrite=P2^5;
sbit lcddatecommand=P2^6;
sbit lcde=P2^7;
uchar code LA_Mask[]="LA_Mask";
uchar code AT_Eagle[]="AT_Eagle";
uchar i;
void delay(uint z)
{
uint x,y;
for(x=z;x>0;x--)
{
for(y=0;y<=112;y++)
{
}
}
}
void write_command(uchar command)//寫(xiě)指令
{
lcddatecommand=0;
lcdwrite=0;
P0=command;
delay(1);
lcde=1;
delay(1);
lcde=0;
}
void write_date(uchar date)//寫(xiě)數據
{
lcddatecommand=1;
lcdwrite=0;
P0=date;
delay(5);
lcde=1;
delay(5);
lcde=0;
}
void init()
{
lcde=0;
write_command(0x38);//設置16*2顯示,5*7點(diǎn)陣,8位數據接口
write_command(0x0c);//設置開(kāi)顯示,不顯示光標
write_command(0x06);// 寫(xiě)一個(gè)字符后地址指針加1
write_command(0x01);//顯示清0,數據指針清0
}
void main()
{
init();
write_command(0x80+0x10);
for(i=0;i<7;i++)
{
write_date(LA_Mask[i]);
delay(1);
}
write_command(0x80+0x50);
for(i=0;i<8;i++)
{
write_date(AT_Eagle[i]);
delay(1);
}
for(i=0;i<16;i++)
{
write_command(0x18);//整屏左移,同時(shí)光標跟隨移動(dòng)
//write_command(0x1c);//整屏右移,同時(shí)光標跟隨移動(dòng)
delay(200);
}
while(1);
}


上一頁(yè) 1 2 下一頁(yè)

關(guān)鍵詞: 1602液晶操作方法代

評論


技術(shù)專(zhuān)區

關(guān)閉
国产精品自在自线亚洲|国产精品无圣光一区二区|国产日产欧洲无码视频|久久久一本精品99久久K精品66|欧美人与动牲交片免费播放
<dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><small id="yhprb"></small><dfn id="yhprb"></dfn><small id="yhprb"><delect id="yhprb"></delect></small><small id="yhprb"></small><small id="yhprb"></small> <delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"></dfn><dfn id="yhprb"></dfn><s id="yhprb"><noframes id="yhprb"><small id="yhprb"><dfn id="yhprb"></dfn></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><small id="yhprb"></small><dfn id="yhprb"><delect id="yhprb"></delect></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn> <small id="yhprb"></small><delect id="yhprb"><strike id="yhprb"></strike></delect><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn><dfn id="yhprb"><s id="yhprb"><strike id="yhprb"></strike></s></dfn><dfn id="yhprb"><s id="yhprb"></s></dfn>