看啥推荐读物
专栏名称: 老兵笔记
郑昀,☑移动数据业务 6年 + ☑语义聚合 4年 + ☑O2O 10年的老兵,讲述技术人生和职场感悟。花名昀哥。
今天看啥  ›  专栏  ›  老兵笔记

【Arduino】RFID-RC522 Hack II

老兵笔记  · 公众号  ·  · 2023-03-15 00:20
一,ChatGPT问答话说我有一天问ChatGPT:我在用 Arduino Uno 开发板和 Arduino IDE 做开发。现在想进一步试验如何在门禁刷卡的过程中校验 M1 卡,你有什么建议吗?它回答说:如果您想在门禁刷卡过程中校验 M1 卡,可以考虑在 Arduino 中编写代码,读取 M1 卡的 UID 和卡片中存储的数据,然后将 UID 和预先存储的数据进行比对,以验证卡片是否有效。以下是一个简单的代码示例,可以帮助您开始:#include #include  #define SS_PIN 10#define RST_PIN 9 MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance. void setup() { Serial.begin(9600); // Initialize serial communication. SPI.begin(); // Initialize SPI bus. mfrc522.PCD_Init(); // Initialize MFRC522.} void loop() { // Look for new cards. if (mfrc522.PICC_IsNewCardPresent() && mfrc522.PICC_ReadCardSerial()) { // Get the UID of the card. String uid = ""; for (byte i = 0; i mfrc522.uid.size; i++) { ………………………………

原文地址:访问原文地址
快照地址: 访问文章快照