欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

標(biāo)題: UHF門禁系統(tǒng)源碼 [打印本頁]

作者: SZYASL    時(shí)間: 2018-5-31 11:00
標(biāo)題: UHF門禁系統(tǒng)源碼
單片機(jī)源程序如下:
  1. /*****************************************************************
  2. 使用說明:LED3閃爍后才可放卡,若刷卡過程中LED3閃爍兩次,則說明刷卡
  3. 錯(cuò)誤,需重新刷卡,登記標(biāo)簽時(shí),若成功蜂鳴器響LED3亮?xí)貜?fù)兩次
  4. ******************************************************************/

  5. #include "reg52.h"

  6. #define main_globals
  7. #include "main.h"

  8. #include "uart.h"
  9. #include "lcd12864.h"
  10. #include "beep.h"
  11. #include "key.h"  
  12. #include "timer.h"
  13. #include "eeprom.h"
  14. #include "ctrl.h"
  15. #include "UHF2010.h"



  16. uchar states=0,t2flag=0;

  17. void init_all(void)        //初始化
  18. {
  19.         uchar status=0x01;
  20.        
  21.         EA = 0;              //關(guān)總中斷
  22.         init_timer();        //定時(shí)器初始化
  23.         init_uart();  //串口初始化  
  24.         lcd_init();          //LCD初始化       
  25.         EA = 1;                  //開總中斷
  26.         EEPROM_READ(0,UII_BUF,40);        //EEPROM初始化,取出記錄的卡號(hào)  
  27.         LengthUII = ((( UII_BUF[0] >> 3) & 0x1F) +1)*2;                //計(jì)算UII長度
  28.         EEPROM_READ(45,KEY_BUF,8);        //EEPROM初始化,取出記錄的密碼
  29.        
  30.         while(status != 0x00)
  31.                 status = UHFCheckConnect();        //檢查連接狀態(tài)
  32. }

  33. void main(void)          //主函數(shù)
  34. {       
  35.         uchar key,status=0x80;

  36.         Delay_ms(500); //讓硬件穩(wěn)定
  37.         init_all();           //執(zhí)行初始化函數(shù)
  38.         relay_OFF();   //關(guān)繼電器
  39.         LED_BLINK_1(); //led test
  40.         beep1();           //beep test        
  41.         display(0,0,0);         //顯示初始化

  42.         while(1)
  43.         {
  44.                 key=key_scan(); //按鍵操作
  45.                 if(key==12)  if(states>0) states--;
  46.                         else states=0;        //上一功能
  47.           
  48.                 if(key==13) if(++states>3) states=3;        //下一功能
  49.                 ctrl_process();
  50.         }
  51. }          
復(fù)制代碼

所有資料51hei提供下載:
UHF門禁系統(tǒng).zip (156.02 KB, 下載次數(shù): 11)







歡迎光臨 (http://m.raoushi.com/bbs/) Powered by Discuz! X3.1