Created
July 26, 2026 12:36
-
-
Save ajangrahmat/b15e6cfe49c964eb13b965eabd81ac4c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <SPI.h> | |
| #include <RFID.h> | |
| #define SS_PIN 10 | |
| #define RST_PIN 9 | |
| RFID rfid(SS_PIN,RST_PIN); | |
| void setup() { | |
| Serial.begin(9600); | |
| SPI.begin(); | |
| rfid.init(); | |
| } | |
| void loop() { | |
| if(rfid.isCard()){ | |
| if(rfid.readCardSerial()){ | |
| Serial.print(rfid.serNum[0]); | |
| Serial.print(" "); | |
| Serial.print(rfid.serNum[1]); | |
| Serial.print(" "); | |
| Serial.print(rfid.serNum[2]); | |
| Serial.print(" "); | |
| Serial.print(rfid.serNum[3]); | |
| Serial.print(" "); | |
| Serial.println(rfid.serNum[4]); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment