1024手机基地看电影,午夜福利视频导航,国产精品福利在线一区,亚洲欧美日韩另类成人,在线观看午夜日本理论片,成年超爽免费网站,国产精品成人免费,精品动作一级毛片,成人免费观看网站,97精品伊人久久大香蕉

標(biāo)題: BCD譯碼的2為數(shù)碼管的數(shù)字掃描顯示 [打印本頁]

作者: 快樂肥宅水    時間: 2018-6-6 16:45
標(biāo)題: BCD譯碼的2為數(shù)碼管的數(shù)字掃描顯示
#include<reg52.h>
#define uint unsigned int
void delay7ms(void)   //?? -0.217013888891us
{
    unsigned char a,b;
    for(b=208;b>0;b--)
        for(a=14;a>0;a--);
}
void delay2ms(void)   //?? -0.217013888889us
{
    unsigned char a,b;
    for(b=80;b>0;b--)
        for(a=10;a>0;a--);
}
void main(void)
{
uint led[10]={0xc0,0xf9,0xa4, 0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
uint m,n=0,a=0;
for(m=0;m<=10;m++)
{
while(a<30)
  {
    if(m==10)
    {
  m=0;
     n++ ;
     if(n==10)
     n=0;
}
   P0=led[m];
   P2=0x40;
   delay7ms();
   P2=0x00;
   delay2ms();
   P0=led[n];
   P2=0x80;
   delay7ms();
   P2=0x00;
   delay2ms();
a++;
  }
   a=0;
}
}






歡迎光臨 (http://www.raoushi.com/bbs/) Powered by Discuz! X3.1