在线看毛片网站电影-亚洲国产欧美日韩精品一区二区三区,国产欧美乱夫不卡无乱码,国产精品欧美久久久天天影视,精品一区二区三区视频在线观看,亚洲国产精品人成乱码天天看,日韩久久久一区,91精品国产91免费

    
    
    <address id="vxupu"><td id="vxupu"></td></address>

      <pre id="vxupu"><small id="vxupu"></small></pre>
      <dfn id="vxupu"></dfn>
      <div id="vxupu"><small id="vxupu"></small></div>
    1. 新聞中心

      EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計應(yīng)用 > PCF8583+LM1602的protues仿真實(shí)例(C語言)

      PCF8583+LM1602的protues仿真實(shí)例(C語言)

      作者: 時間:2016-11-25 來源:網(wǎng)絡(luò) 收藏
      程序代碼:

      #include
      #include
      #include
      #define lcdwritecmd XBYTE[0xFC00]
      #define ledwritedat XBYTE[0xFE00]
      sbit SCL=P1^0 ;
      sbit SDA=P1^1 ;
      char tab[2];
      unsigned char year,mon,day,hour,min,sec,state,hudsec;
      //============================延時函數(shù)====================================
      void delay(unsigned char n)
      {
      unsigned char i,j;
      for(i=0;i for(j=0;j<5;j++);
      }
      void delayshort()
      {
      _nop_();
      _nop_();
      _nop_();
      _nop_();
      }
      //=========================================================================
      //============================1602寫指令函數(shù)===============================
      void writecmd(unsigned char a)
      {
      delay(100);
      lcdwritecmd=a;
      }
      //=========================================================================
      //============================1602寫數(shù)據(jù)函數(shù)===============================
      void writedata(char lcddata)
      {
      delay(10);
      ledwritedat=lcddata;
      }
      //=========================================================================
      //===========================1602顯示字符串據(jù)函數(shù)==========================
      void displaystring(unsigned char add,unsigned char n,char tab[])
      {
      unsigned char i;
      for(i=0;i {
      writecmd(add+i);
      writedata(tab[i]);
      delay(100);
      }
      }
      //=========================================================================
      //===========================I2C開始信號函數(shù)===============================
      void start()
      {

      本文引用地址:http://www.biyoush.com/article/201611/321406.htm

      }
      //=========================================================================
      //===========================I2C結(jié)束信號函數(shù)===============================
      void stop()
      {

      }
      //=========================================================================
      //===========================I2C從機(jī)等待應(yīng)答信號函數(shù)=======================
      void waitack()
      {

      }
      //=========================================================================
      //===========================I2C主機(jī)應(yīng)答信號函數(shù)===========================
      void mack()
      {

      }
      //=========================================================================
      //===========================I2C寫一個字節(jié)函數(shù)=============================
      void write_byte(unsigned char a)
      {

      }
      //=========================================================================
      //===========================I2C讀一個字節(jié)函數(shù)=============================
      unsigned char read_byte()
      {

      }
      //=========================================================================
      //===========================PCF8583寫函數(shù)=================================
      //參數(shù)adr:寄存器地址
      //參數(shù)dat:寫入得數(shù)據(jù)
      void PCF8583_write(unsigned char adr,unsigned char dat)
      {
      start();
      write_byte(0xa0);
      waitack();
      write_byte(adr);
      waitack();
      write_byte(dat);
      waitack();
      stop();
      }
      //=========================================================================
      //===========================PCF8583讀函數(shù)=================================
      //連續(xù)讀區(qū)以00起始地址的7個單元的數(shù)據(jù)
      void PCF8583_read()
      {
      start();
      write_byte(0xA0);
      waitack();
      write_byte(0x00);
      waitack();
      stop();
      start();
      write_byte(0xA1);
      waitack();
      state = read_byte(); // 讀狀態(tài)寄存器的值
      mack();
      hudsec = read_byte(); // 讀百分之一秒數(shù)值寄存器的值
      mack();
      sec = read_byte(); // 讀秒數(shù)值寄存器的值
      mack();
      min = read_byte(); // 讀分?jǐn)?shù)值寄存器的值
      mack();
      hour = read_byte(); // 讀時數(shù)值寄存器的值
      mack();
      day = read_byte(); // 讀天數(shù)值寄存器的值
      mack();
      mon = read_byte(); // 讀時月值寄存器的值
      mack();
      stop();

      }


      上一頁 1 2 下一頁

      關(guān)鍵詞: PCF8583LM1602protues仿

      評論


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

      關(guān)閉