日本久久久久曰精品免费,国产精品一级二级三级,乱子伦av无码中文字幕s,国产成人精品一区免费视频

技術(shù)熱線: 4007-888-234
設(shè)計(jì)開發(fā)

專注差異化嵌入式產(chǎn)品解決方案 給智能產(chǎn)品定制注入靈魂給予生命

開發(fā)工具

提供開發(fā)工具、應(yīng)用測(cè)試 完善的開發(fā)代碼案例庫分享

技術(shù)支持

從全面的產(chǎn)品導(dǎo)入到強(qiáng)大技術(shù)支援服務(wù) 全程貼心伴隨服務(wù),創(chuàng)造無限潛能!

新品推廣

提供新的芯片及解決方案,提升客戶產(chǎn)品競(jìng)爭力

新聞中心

提供最新的單片機(jī)資訊,行業(yè)消息以及公司新聞動(dòng)態(tài)

秒表在MCD2配套的實(shí)驗(yàn)板可以運(yùn)行

更新時(shí)間: 2019-03-23
閱讀量:2187

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

#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控制啟動(dòng),停止,啟動(dòng).   

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

主站蜘蛛池模板: 沂南县| 新干县| 重庆市| 东宁县| 临城县| 晋江市| 老河口市| 永春县| 图木舒克市| 麻栗坡县| 昌平区| 辽中县| 岱山县| 棋牌| 积石山| 泌阳县| 铁岭市| 镇原县| 锦州市| 岱山县| 饶平县| 敖汉旗| 平舆县| 巴青县| 潞城市| 班戈县| 鄂温| 乌兰县| 额尔古纳市| 遵义市| 齐齐哈尔市| 济南市| 沾化县| 定结县| 乌鲁木齐市| 明光市| 丰都县| 墨脱县| 临桂县| 分宜县| 徐州市|