Autoformat example MinimalInterrupt.ino
- auto format from arduino ide - unsigned char -> byte
This commit is contained in:
@@ -31,14 +31,14 @@
|
|||||||
|
|
||||||
#define RST_PIN 9 // Configurable, see typical pin layout above
|
#define RST_PIN 9 // Configurable, see typical pin layout above
|
||||||
#define SS_PIN 3 // Configurable, see typical pin layout above
|
#define SS_PIN 3 // Configurable, see typical pin layout above
|
||||||
#define IRQ_PIN 2
|
#define IRQ_PIN 2 // Configurable, depends on hardware
|
||||||
|
|
||||||
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
|
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance.
|
||||||
|
|
||||||
MFRC522::MIFARE_Key key;
|
MFRC522::MIFARE_Key key;
|
||||||
|
|
||||||
volatile boolean bNewInt = false;
|
volatile boolean bNewInt = false;
|
||||||
unsigned char regVal = 0x7F;
|
byte regVal = 0x7F;
|
||||||
void activateRec(MFRC522 mfrc522);
|
void activateRec(MFRC522 mfrc522);
|
||||||
void clearInt(MFRC522 mfrc522);
|
void clearInt(MFRC522 mfrc522);
|
||||||
|
|
||||||
@@ -53,7 +53,7 @@ void setup() {
|
|||||||
mfrc522.PCD_Init(); // Init MFRC522 card
|
mfrc522.PCD_Init(); // Init MFRC522 card
|
||||||
|
|
||||||
/* read and printout the MFRC522 version (valid values 0x91 & 0x92)*/
|
/* read and printout the MFRC522 version (valid values 0x91 & 0x92)*/
|
||||||
Serial.print("Ver: 0x");
|
Serial.print(F("Ver: 0x"));
|
||||||
byte readReg = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);
|
byte readReg = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);
|
||||||
Serial.println(readReg, HEX);
|
Serial.println(readReg, HEX);
|
||||||
|
|
||||||
@@ -77,16 +77,15 @@ void setup() {
|
|||||||
} while (!bNewInt);
|
} while (!bNewInt);
|
||||||
bNewInt = false;
|
bNewInt = false;
|
||||||
|
|
||||||
Serial.println("End setup");
|
Serial.println(F("End setup"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Main loop.
|
* Main loop.
|
||||||
*/
|
*/
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|
||||||
if (bNewInt) { //new read interrupt
|
if (bNewInt) { //new read interrupt
|
||||||
Serial.print("Interrupt. ");
|
Serial.print(F("Interrupt. "));
|
||||||
mfrc522.PICC_ReadCardSerial(); //read the tag data
|
mfrc522.PICC_ReadCardSerial(); //read the tag data
|
||||||
// Show some details of the PICC (that is: the tag/card)
|
// Show some details of the PICC (that is: the tag/card)
|
||||||
Serial.print(F("Card UID:"));
|
Serial.print(F("Card UID:"));
|
||||||
@@ -136,4 +135,3 @@ void clearInt(MFRC522 mfrc522){
|
|||||||
mfrc522.PCD_WriteRegister(mfrc522.ComIrqReg, 0x7F);
|
mfrc522.PCD_WriteRegister(mfrc522.ComIrqReg, 0x7F);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user