200字范文,内容丰富有趣,生活中的好帮手!
200字范文 > 51单片机实现c语言字母滚动 基于51单片机的led点阵滚动显示上下左右c语言程序.docx...

51单片机实现c语言字母滚动 基于51单片机的led点阵滚动显示上下左右c语言程序.docx...

时间:2020-11-15 10:40:13

相关推荐

51单片机实现c语言字母滚动 基于51单片机的led点阵滚动显示上下左右c语言程序.docx...

***********

*

*

*LED点阵实验(左右上下流动显示)

*******************************************************************************

***********/

#i nclude

un sig ned char code taba[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};

un sig ned char code tabb[]={0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};

void delay1(void)

{

un sig ned char i,j,k;

for(k=10;k>0;k--)

for(i=20;i>0;i--)

for(j=248;j>0;j--);

}

void mai n(void)

{

un sig ned char i,j;

while(1)

{

for(j=0;j<3;j++)〃 //from left to right 3 time

{

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

{

P2=taba[i];

P0=0xff;

delay1();

}

}

for(j=0;j<3;j++)〃 //from right to left 3 time

{

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

{

P2=taba[7-i];

PO=Oxff;

delay1();

}

}

for(j=0;j<3;j++)〃//from top to bottom 3 time

{

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

{

P2=0x00;

P0=tabb[7-i];

delay1();

}

}

for(j=0;j<3;j++)〃//from bottom to top 3 time

{

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

{

P2=0x00;

P0=tabb[i];

delay1();

}

}

}

}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。