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

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 2330|回復: 3
打印 上一主題 下一主題
收起左側

求RFID庫函數,MFRC522的Arduino庫函數

[復制鏈接]
回帖獎勵 25 黑幣 回復本帖可獲得 5 黑幣獎勵! 每人限 1 次
跳轉到指定樓層
樓主
ID:712171 發表于 2020-4-13 12:01 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
制作門禁系統,但是看不懂程序,沒找到MFEC522的庫函數,還請各位大佬能留下
分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:933981 發表于 2021-6-7 00:32 | 只看該作者
areduino   ide里面有
回復

使用道具 舉報

板凳
ID:808634 發表于 2021-6-7 12:29 | 只看該作者
論壇里應該有
回復

使用道具 舉報

地板
ID:155507 發表于 2021-6-7 13:56 | 只看該作者
MFRC522的Arduino函數
  1. /*
  2. *
  3. * All the resources for this project:
  4. * Modified by Aritro Mukherjee
  5. *
  6. *
  7. */

  8. #include <SPI.h>
  9. #include <MFRC522.h>

  10. #define SS_PIN 10
  11. #define RST_PIN 9
  12. MFRC522 mfrc522(SS_PIN, RST_PIN);   // Create MFRC522 instance.

  13. void setup()
  14. {
  15.   Serial.begin(9600);   // Initiate a serial communication
  16.   SPI.begin();      // Initiate  SPI bus
  17.   mfrc522.PCD_Init();   // Initiate MFRC522
  18.   Serial.println("Approximate your card to the reader...");
  19.   Serial.println();

  20. }
  21. void loop()
  22. {
  23.   // Look for new cards
  24.   if ( ! mfrc522.PICC_IsNewCardPresent())
  25.   {
  26.     return;
  27.   }
  28.   // Select one of the cards
  29.   if ( ! mfrc522.PICC_ReadCardSerial())
  30.   {
  31.     return;
  32.   }
  33.   //Show UID on serial monitor
  34.   Serial.print("UID tag :");
  35.   String content= "";
  36.   byte letter;
  37.   for (byte i = 0; i < mfrc522.uid.size; i++)
  38.   {
  39.      Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
  40.      Serial.print(mfrc522.uid.uidByte[i], HEX);
  41.      content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
  42.      content.concat(String(mfrc522.uid.uidByte[i], HEX));
  43.   }
  44.   Serial.println();
  45.   Serial.print("Message : ");
  46.   content.toUpperCase();
  47.   if (content.substring(1) == "BD 31 15 2B") //change here the UID of the card/cards that you want to give access
  48.   {
  49.     Serial.println("Authorized access");
  50.     Serial.println();
  51.     delay(3000);
  52.   }

  53. else   {
  54.     Serial.println(" Access denied");
  55.     delay(3000);
  56.   }
  57. }
復制代碼



MFRC522-1.4.8.zip

1.16 MB, 下載次數: 18

回復

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術交流QQ群281945664

Powered by 單片機教程網

快速回復 返回頂部 返回列表