Back to Parent

// This #include statement was automatically added by the Particle IDE.
#include <MFRC522.h>

#define SS_PIN SS
#define RST_PIN D2
 
MFRC522 mfrc522(SS_PIN, RST_PIN);	// Create MFRC522 instance.
 
void setup() {
    delay(5000);
	// Initialize serial communications with the computer
	Serial.begin(9600);	
	mfrc522.setSPIConfig(); // sets up SPI config
 
	mfrc522.PCD_Init();	// Initialize RC522 card
	Serial.println("Start Scanning");
}
 
void loop() {
	// Look for new cards
	if ( ! mfrc522.PICC_IsNewCardPresent()) {
		return;
	}
	Serial.println("New card Detected");
	// Read tapped card data
	if ( ! mfrc522.PICC_ReadCardSerial()) {
		return;
	}
	Serial.println("Detected");
 
	//Dump all card data to Serial
	mfrc522.PICC_DumpToSerial(&(mfrc522.uid));
}
Click to Expand

Content Rating

Is this a good/useful/informative piece of content to include in the project? Have your say!

0