av在线观看网站免费,欧美成人aaa片一区国产精品,精品国产乱码久久久久久免费,麻豆果冻传媒2021精品传媒一区,国产精品自在欧美一区

電子文檔交易市場
安卓APP | ios版本
電子文檔交易市場
安卓APP | ios版本

51單片機電子時鐘--程序

3頁
  • 賣家[上傳人]:戀****泡
  • 文檔編號:94899484
  • 上傳時間:2019-08-12
  • 文檔格式:DOC
  • 文檔大?。?8.50KB

  • 文檔加載中……請稍候!
    如果長時間未打開,您也可以點擊刷新試試。

    下載文檔到電腦,查找使用更方便

    10 金貝

    還剩頁未讀,繼續(xù)閱讀

    / 3 舉報 版權申訴 馬上下載
  • 文本預覽
  • 下載提示
  • 常見問題
    • include #define uint unsigned int #define uchar unsigned char #define s_count_max 60 #define min_cou_max 60 #define h_count_max 24 unsigned int inttrupt_count=0; unsigned int s_count=0; unsigned int min_cou=0; unsigned int h_count=0; uchar code LED_table[10]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f};//相應段碼 uchar code bittable[6]={0xf8,0xf4,0xec,0xdc,0xbc,0x7c}; //相應位碼 uchar clockstr[6]={0,0,0,0,0,0}; void dl_ms(){ uint j; for(j=0;j<200;j++);//延時}void display(){ uchar i; for(i=0;i<6;i++) //6個數(shù)碼管 { P0=~(clockstr[i]); P2=bittable[i]; dl_ms(); }} void update_clockstr(void){ clockstr[0]=LED_table[s_count%10]; clockstr[1]=LED_table[(int)(s_count/10)]; clockstr[2]=LED_table[min_cou%10]; clockstr[3]=LED_table[(int)(min_cou/10)]; clockstr[4]=LED_table[h_count%10]; clockstr[5]=LED_table[(int)(h_count/10)];/**/ display();} void main() //測試{ h_count=23; min_cou=59; s_count=50; inttrupt_count=0; EA=1; //中斷 ET0=1; TMOD=0X01; TH0=-20000/256; TL0=-20000%256; TR0=1; for(;;) { update_clockstr(); }}void timer0() interrupt 1 using 1 //完成1s定時 20ms定時 共50次{ inttrupt_count++; TH0=-20000/256; TL0=-20000%256; if (inttrupt_count==50) { inttrupt_count=0; s_count++; if(60==s_count) //(60==s_count) { s_count=0; min_cou++; if(60==min_cou) { min_cou=0; h_count++; if(24==h_count) h_count=0; } } }}。

      點擊閱讀更多內(nèi)容
    關于金鋤頭網(wǎng) - 版權申訴 - 免責聲明 - 誠邀英才 - 聯(lián)系我們
    手機版 | 川公網(wǎng)安備 51140202000112號 | 經(jīng)營許可證(蜀ICP備13022795號)
    ?2008-2016 by Sichuan Goldhoe Inc. All Rights Reserved.