標(biāo)題:
51單片機數(shù)碼管顯示HELLO技術(shù)
[打印本頁]
作者:
jamac
時間:
2022-1-2 14:09
標(biāo)題:
51單片機數(shù)碼管顯示HELLO技術(shù)
#include<reg51.h>
void delay(unsigned int i)
{
unsigned int k;
for(k=0;k<i;k++);
}
void disp3()
{
unsigned char ledmove[]={0xff,0xff,0xff,0xff,0xff,0x89,0x86,0xc7,0xc7,0xc0,0xff,0xff,0xff,0xff,0xff};
unsigned char com[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf};
unsigned char i,j,num;
for(num=0;num<10;num++)
for(j=0;j<100;j++)
for(i=0;i<6;i++)
{
P1=0xff;
P2=com[i];
P1=ledmove[num+i];
delay(100);
}
}
void main()
{
while(1) disp3();
}
復(fù)制代碼
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1