找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2186|回复: 1
打印 上一主题 下一主题
收起左侧

单片机rc500考勤机电路程序分享

[复制链接]
跳转到指定楼层
楼主
考勤机电路原理图如下:


单片机源程序如下:
  1. /*************************************************************************/
  2. #include <string.h>
  3. #include <m500a.h>
  4. #include <main.h>
  5. #include <reg52.h>

  6. sbit   LED  =  P2^6;
  7. sbit   WARN =  P2^7;


  8. ////////////////////////////////////////////////////////////////////
  9. void    main (void)
  10. {
  11. //  unsigned char counter;

  12.   unsigned char status1,cnt;
  13.   unsigned char Snr_RC500[4];       // Serial Number of the MFRC500
  14.   unsigned char cardserialno[4];
  15.   unsigned char cardtype[2];

  16.   P2 = 0x00;
  17.   LED = 1;WARN = 1;
  18.   init_lcd();
  19.   clrram();
  20.   timer_init();
  21.   line_disp(0,message_init[0]);
  22.   rs232_init();                                                                                                            
  23.   RC500Config();      // Initialise the RC500


  24.   PcdReadE2(8,4,Snr_RC500); // Read out the MFRC500 serial number and store it
  25.   rs232_send(Snr_RC500,4);

  26.   line_disp(0,message_init[0]);
  27.   line_disp(1,message_init[1]);
  28.   line_disp(2,message_init[2]);
  29.   line_disp(3,message_init[3]);
  30.   delay_1s(1200);
  31.   clrram();
  32.   time_disp2();
  33.   line_disp(1,line);
  34.   line_disp(2,init_finish);
  35.   line_disp(3,line);
  36.   delay_1s(1200);
  37.   clrram();

  38.   time_disp1();
  39.   line_disp(2,line);
  40.   line_disp(3,inputcard);
  41.   LED = 0;
  42.   while(1)
  43.     {                                                                                                                                                                                                                           
  44.          while(CardRequest(PICC_REQALL, cardtype)==MI_OK)
  45.             {
  46.                 status1=ReadCardNum(0,cardserialno);
  47.                 if (status1 == MI_OK)
  48.                         {
  49.                         cnt = compare(card,cardserialno);
  50.                         clrram();
  51.                         if(cnt > CARD_NUM)
  52.                                 {
  53.                                 line_disp(0,error1);
  54.                                 line_disp(2,error2);
  55.                                 WARN = 0;
  56.                                 }
  57.                         else
  58.                                 {
  59.                                 line_disp(2,name[cnt]);
  60.                                 line_disp(3,welcome);
  61.                                 line_disp(1,line);
  62.                                 time_disp2();
  63.                                 LED = 1;
  64.                                 }
  65.                          rs232_send(cardserialno,4);
  66.                         }
  67.                 delay_1s(500);
  68. ……………………

  69. …………限于本文篇幅 余下代码请从51黑下载附件…………
复制代码

所有资料51hei提供下载:
考勤机程序(已经验证成功)并有电路图.7z (5.41 MB, 下载次数: 48)


评分

参与人数 1黑币 +50 收起 理由
admin + 50 共享资料的黑币奖励!

查看全部评分

分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 顶 踩
回复

使用道具 举报

沙发
ID:452950 发表于 2020-2-22 17:40 | 只看该作者
附件解压后显示的空文件夹,实际占用10.5M,在资源管理器选择显示隐藏文件后才能看到。
。。。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表