<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > 單片機電子時鐘程序

          單片機電子時鐘程序

          作者: 時間:2016-11-29 來源:網(wǎng)絡(luò) 收藏



          本文引用地址:http://www.ex-cimer.com/article/201611/323559.htm
          /********************************************************************************
          品名:電子時鐘
          功能:秒表,鬧鐘,日歷,計數(shù)器,頻率計 時鐘
          作者:阿飛
          版本:v1.4
          修改:二月調(diào)整bug code unsigned char leab_day[12]={31,28,31,30,31,30,31,31,30,31,30,31};
          改成 code unsigned char leab_day[12]={31,29,31,30,31,30,31,31,30,31,30,31};
          時間:2012,8,11
          版權(quán)所有:http://www.51hei.com
          ********************************************************************************/
          #include
          sbit sh=P1^7;
          sbit ds=P1^5;
          sbit st=P1^6;
          sbit led0 = P1^2;
          sbit led1 = P1^3;
          sbit led2 = P1^4;
          sbit led3 = P1^1;
          sbit button1 = P3^2;
          sbit button2 = P3^3;
          sbit button3 = P3^4;
          sbit buzzer = P1^0;
          sbit RCLK = P3^7;
          typedef struct
          {
          unsigned char count;
          unsigned char sec;
          unsigned char min;
          unsigned char hou;
          unsigned char day;
          unsigned char mon;
          unsigned char year[2];
          unsigned char AlarmMin;
          unsigned char AlarmHou;
          unsigned char stopwatch[3];
          unsigned char cymometer[2];
          unsigned char cymometer_count;
          unsigned char flashcount;
          unsigned char mode;
          unsigned char delaycount;
          unsigned char ditheringcount;
          unsigned char February_day;
          }TIME;
          typedef union
          {
          struct
          {
          unsigned char bit0:1;
          unsigned char bit1:1;
          unsigned char bit2:1;
          unsigned char bit3:1;
          unsigned char bit4:1;
          unsigned char bit5:1;
          unsigned char bit6:1;
          unsigned char bit7:1;
          }BIT;
          unsigned char byte;
          }BETY_BIT;

          extern BETY_BIT BIT_FLAG,BIT_FLAG1;
          extern TIME time;
          extern void isr_button1_proces(void);
          extern void isr_button2_proces(void);
          extern void isr_button3_proces(void);

          #define menu_button1_down_1 BIT_FLAG.BIT.bit0
          #define menu_button1_down BIT_FLAG.BIT.bit1
          #define flash_flag BIT_FLAG.BIT.bit2
          #define flash_control BIT_FLAG.BIT.bit3
          #define menu_button2_down BIT_FLAG.BIT.bit4
          #define button2_length_whack_flagBIT_FLAG.BIT.bit5
          #define Alarm_on_offBIT_FLAG.BIT.bit6
          #define start_stopwatch BIT_FLAG.BIT.bit7
          #define menu_button3_down BIT_FLAG1.BIT.bit0
          #define button3_length_whack_flagBIT_FLAG1.BIT.bit1
          #define stopwatch_clear_flag BIT_FLAG1.BIT.bit2
          //#define Alarm_on_off_display BIT_FLAG1.BIT.bit3
          #define cymometer_start_flagBIT_FLAG1.BIT.bit4
          #define cymometer1_start_flagBIT_FLAG1.BIT.bit5
          #define leap_year_flag BIT_FLAG1.BIT.bit6
          #define dithering_flag BIT_FLAG1.BIT.bit7
          /*******************************************************
          上一頁 1 2 3 下一頁

          關(guān)鍵詞: 單片機電子時

          評論


          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();