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

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > 1602 AVR單片機版 報警指示功能

          1602 AVR單片機版 報警指示功能

          作者: 時間:2016-11-30 來源:網絡 收藏
          使用的是ATMEGA16芯片
          功能說明:正常狀態(tài)下,8個LED不停閃爍,1602顯示normal indication指示
          報警狀態(tài)下, 8個LED全發(fā)亮不閃爍,1602顯示alarm報警,只有按復位按鈕才能解除報警.
          alarm狀態(tài)時,由于PB口的低3位和,1602時能,讀寫,數(shù)據(jù)指令寄存器選擇位復用,所以有點暗.
          #include
          #include
          #define uchar unsigned char
          #define uint unsigned int
          #define RS1 PORTB_Bit0=1 //數(shù)據(jù)指令寄存器選擇
          #define RS0 PORTB_Bit0=0
          #define RW1 PORTB_Bit1=1 //讀寫選擇
          #define RW0 PORTB_Bit1=0
          #define EN1 PORTB_Bit2=1 //讀寫時能
          #define EN0 PORTB_Bit2=0
          #define DATAPORT PORTA //1602數(shù)據(jù)口
          #define busy 0x80 //繁忙標志
          #include "ku.h" //調用函數(shù)庫
          //-------------------------------------------
          uchar alarm[]={"alarm "}; //報警字符串
          uchar normal[]={"normal"}; //正常字符串
          uchar indication[]={"indication"};
          //-------------------------函數(shù)聲明--------------

          上一頁 1 2 下一頁

          評論


          技術專區(qū)

          關閉
          看屁屁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); })();