中文字幕无码不卡一区二区三区_少妇被又大又粗又爽毛片久久黑人_91精品国产在热久久无毒不卡_久久久久久亚洲综合网站

技術(shù)熱線: 4007-888-234

技術(shù)支持

秒表在MCD2配套的實驗板可以運行

更新時間: 2019-03-23

十年專注單片機方案開發(fā)的方案公司英銳恩,分享秒表在MCD2配套的實驗板可以運行。英銳恩現(xiàn)提供服務產(chǎn)品涉及主控芯片:8位單片機、16位單片機、32位單片機及各類運算放大器等。

#include//PIC16F877A
static int table[10]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
static int table1[6]={0xef,0xdf,0xfb,0xf7,0xfe,0xfd};
int sreg=0x00;
int i;
int s0=0x00,s1=0x00,s2=0x00,s3=0x00,s4=0x00,s5=0x00;
void INITIAL()
{
  TRISC=0x00;
  TRISA=0x00;
  TRISB0=1;
}
void tmint()
{
  T0CS=0;
  PSA=1;
  T0IF=0;
  T0IE=1;
 }
void DELAY()

   for(i=300;--i;){;}
  }
void DELAY2()

   for(i=2000;--i;){;}
  }
void  displays()
{
     PORTA=table1[0];

PORTC=table[s0];
         DELAY();
        PORTA=table1[1];
         PORTC=table[s1];
         DELAY();
        PORTA=table1[2];
         PORTC=table[s2];
         DELAY();
      PORTA=table1[3];
         PORTC=table[s3];
         DELAY();
        PORTA=table1[4];

PORTC=table[s4];
         DELAY();
      PORTA=table1[5];
         PORTC=table[s5];
         DELAY();
}
void  KEYSCAN()
{
   while(1)
    {
      
       while(1)
        {
          displays();
          if(RB0==0) break;
        }
        DELAY2();
         if(RB0==0) break;
    }
}
void keyrelax()
{
  while(1)
   {
     displays();
     if(RB0==1) break;
   }
}

void interrupt clkint(void)
{
 
   TMR0=0X13;
   T0IF=0;
   CLRWDT();
   sreg++;
   if(sreg==40)
    {
      sreg=0;
      s0++;
      if(s0==10)
       { s0=0;
         s1++;

 if(s1==10)
          { s1=0;
            s2++;
            if(s2==10)
             { s2=0;s3++;
               if(s3==6)
                 { s3=0;
                   s4++;
                   if(s4==10)
                     {s4=0; s5++;
                        if(s5==6) s5=0;
                        
                      }
               
                  }
               }
          
            }
         }
    }
 }

main()
{
  tmint();
 INITIAL();
di();
while(1)

 {
     KEYSCAN();
     keyrelax();
     ei();
     TMR0=0X08;
      KEYSCAN();
     keyrelax();
     di();
     KEYSCAN();
     keyrelax();
     ei();
      }
}
分辯度0.01S.

RB0控制啟動,停止,啟動.   

(文源網(wǎng)絡,侵刪)

404
返回首頁 |  返回上一頁
宁武县| 南华县| 米林县| 甘肃省| 贵港市| 阿图什市| 乐业县| 虹口区| 晋宁县| 云龙县| 桐乡市| 鹤峰县| 额尔古纳市| 乌什县| 收藏| 调兵山市| 湛江市| 平江县| 淮滨县| 新化县| 丘北县| 大关县| 宜宾县| 修文县| 共和县| 扶风县| 黔江区| 北流市| 南郑县| 客服| 沈阳市| 西贡区| 莱芜市| 米脂县| 涟源市| 城市| 棋牌| 天祝| 洛扎县| 鲁甸县| 藁城市|