微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > 51单片机-240128液晶程序与调试

51单片机-240128液晶程序与调试

时间:11-13 来源:互联网 点击:

ar i,j;

gotoxy(0,0);

for(j=0;j<32;j++)

{

for(i=0;i<60;i++)

{

lcd_datawrite(data1);

//delay1(1000);

}

for(i=0;i<60;i++)

{

lcd_datawrite(data2);

}

}

}

//---------------------------------------------

void lcd_character(uchar code *cha,int count) small

{

int i;

for(i=0;i

{

lcd_datawrite(*cha);

++cha;

}

}

//---------------------------------------------

extern void gotoxy(uchar x,uchar y) small

{

lcd_regwrite(0x60,x); // active window top register(awtr)

lcd_regwrite(0x70,y); // active window top register(awtr)

}

//=============================================

void main (void)

{

lcd_reset();

lcd_initial();

lcd_clear();

while(1)

{

lcd_regwrite(0x00,0xcd);

lcd_regwrite(0x10,0x2b);

gotoxy(0x00,0x00);

lcd_character(tab1,240);

delay1(3000);

lcd_regwrite(0x00,0xc5);

lcd_lattice(0xcc,0xcc);

delay1(3000);

lcd_lattice(0x33,0x33);

delay1(3000);

lcd_photo(tab3);

delay1(3000);

lcd_regwrite(0x00,0xcd);

lcd_regwrite(0x10,0x3b);

gotoxy(0x00,0x00);

lcd_character(tab2,240);

delay1(3000);

lcd_regwrite(0x00,0xc5);

lcd_lattice(0xcc,0x33);

delay1(3000);

}

}


Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top