Я хочу использовать Grade HSPI вместо Grade VSPI, и я не знаю, как это сделать. Я немного искал, но ничего не смог найти.
#include <SPI.h>
#include <MFRC522.h>
#define RST_PIN 4 // Configurable, see typical pin layout above
#define SS_PIN 2 // Configurable, see typical pin layout above
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance
//*****************************************************************************************//
void setup() {
Serial.begin(9600); // Initialize serial communications with the PC
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522 card
Serial.println("Read personal data on a MIFARE PICC:"); //shows in serial that it is ready to read
}
//*****************************************************************************************//
void loop() {
if ( mfrc522.PICC_IsNewCardPresent()) {
if ( mfrc522.PICC_ReadCardSerial()) {
Serial.println(F("**tag:**"));
for (byte i = 0; i < mfrc522.uid.size; i++){
Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
Serial.print(mfrc522.uid.uidByte[i],HEX);
}
Serial.println();
mfrc522.PICC_HaltA();
}
}
}