diff --git a/examples/AccessControl/AccessControl.ino b/examples/AccessControl/AccessControl.ino index c0252f5..d0a5387 100644 --- a/examples/AccessControl/AccessControl.ino +++ b/examples/AccessControl/AccessControl.ino @@ -87,12 +87,12 @@ #define LED_OFF LOW #endif -constexpr uint8_t redLed = 7; // Set Led Pins -constexpr uint8_t greenLed = 6; -constexpr uint8_t blueLed = 5; +#define redLed 7 // Set Led Pins +#define greenLed 6 +#define blueLed 5 -constexpr uint8_t relay = 4; // Set Relay Pin -constexpr uint8_t wipeB = 3; // Button pin for WipeMode +#define relay 4 // Set Relay Pin +#define wipeB 3 // Button pin for WipeMode bool programMode = false; // initialize programming mode to false @@ -103,9 +103,8 @@ byte readCard[4]; // Stores scanned ID read from RFID Module byte masterCard[4]; // Stores master card's ID read from EEPROM // Create MFRC522 instance. -constexpr uint8_t RST_PIN = 9; // Configurable, see typical pin layout above -constexpr uint8_t SS_PIN = 10; // Configurable, see typical pin layout above - +#define SS_PIN 10 +#define RST_PIN 9 MFRC522 mfrc522(SS_PIN, RST_PIN); ///////////////////////////////////////// Setup /////////////////////////////////// diff --git a/examples/ChangeUID/ChangeUID.ino b/examples/ChangeUID/ChangeUID.ino index fc53471..19315cd 100644 --- a/examples/ChangeUID/ChangeUID.ino +++ b/examples/ChangeUID/ChangeUID.ino @@ -26,13 +26,13 @@ #include #include -constexpr uint8_t RST_PIN = 9; // Configurable, see typical pin layout above -constexpr uint8_t SS_PIN = 10; // Configurable, see typical pin layout above +#define RST_PIN 9 // Configurable, see typical pin layout above +#define SS_PIN 10 // Configurable, see typical pin layout above MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance /* Set your new UID here! */ -byte newUid[] = {0xDE, 0xAD, 0xBE, 0xEF}; +#define NEW_UID {0xDE, 0xAD, 0xBE, 0xEF} MFRC522::MIFARE_Key key; @@ -92,6 +92,7 @@ void loop() { // } // Set new UID + byte newUid[] = NEW_UID; if ( mfrc522.MIFARE_SetUid(newUid, (byte)4, true) ) { Serial.println(F("Wrote new UID to card.")); } diff --git a/examples/DumpInfo/DumpInfo.ino b/examples/DumpInfo/DumpInfo.ino index 8ee4fc6..5cb0aaa 100644 --- a/examples/DumpInfo/DumpInfo.ino +++ b/examples/DumpInfo/DumpInfo.ino @@ -36,8 +36,8 @@ #include #include -constexpr uint8_t RST_PIN = 9; // Configurable, see typical pin layout above -constexpr uint8_t SS_PIN = 10; // Configurable, see typical pin layout above +#define RST_PIN 9 // Configurable, see typical pin layout above +#define SS_PIN 10 // Configurable, see typical pin layout above MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance diff --git a/examples/FixBrickedUID/FixBrickedUID.ino b/examples/FixBrickedUID/FixBrickedUID.ino index df7a166..391a252 100644 --- a/examples/FixBrickedUID/FixBrickedUID.ino +++ b/examples/FixBrickedUID/FixBrickedUID.ino @@ -25,8 +25,8 @@ #include #include -constexpr uint8_t RST_PIN = 9; // Configurable, see typical pin layout above -constexpr uint8_t SS_PIN = 10; // Configurable, see typical pin layout above +#define RST_PIN 9 // Configurable, see typical pin layout above +#define SS_PIN 10 // Configurable, see typical pin layout above MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance diff --git a/examples/MifareClassicValueBlock/MifareClassicValueBlock.ino b/examples/MifareClassicValueBlock/MifareClassicValueBlock.ino index 9df9348..1d78832 100644 --- a/examples/MifareClassicValueBlock/MifareClassicValueBlock.ino +++ b/examples/MifareClassicValueBlock/MifareClassicValueBlock.ino @@ -31,8 +31,8 @@ #include #include -constexpr uint8_t RST_PIN = 9; // Configurable, see typical pin layout above -constexpr uint8_t SS_PIN = 10; // Configurable, see typical pin layout above +#define RST_PIN 9 // Configurable, see typical pin layout above +#define SS_PIN 10 // Configurable, see typical pin layout above MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance. diff --git a/examples/MinimalInterrupt/MinimalInterrupt.ino b/examples/MinimalInterrupt/MinimalInterrupt.ino index 52340eb..281569c 100644 --- a/examples/MinimalInterrupt/MinimalInterrupt.ino +++ b/examples/MinimalInterrupt/MinimalInterrupt.ino @@ -29,9 +29,9 @@ #include #include -constexpr uint8_t RST_PIN = 9; // Configurable, see typical pin layout above -constexpr uint8_t SS_PIN = 10; // Configurable, see typical pin layout above -constexpr uint8_t IRQ_PIN = 2; // Configurable, depends on hardware +#define RST_PIN 9 // Configurable, see typical pin layout above +#define SS_PIN 3 // Configurable, see typical pin layout above +#define IRQ_PIN 2 // Configurable, depends on hardware MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance. diff --git a/examples/Ntag216_AUTH/Ntag216_AUTH.ino b/examples/Ntag216_AUTH/Ntag216_AUTH.ino index bad4b51..fc9f22c 100644 --- a/examples/Ntag216_AUTH/Ntag216_AUTH.ino +++ b/examples/Ntag216_AUTH/Ntag216_AUTH.ino @@ -12,8 +12,8 @@ #include #include -constexpr uint8_t RST_PIN = 9; // Configurable, see typical pin layout above -constexpr uint8_t SS_PIN = 10; // Configurable, see typical pin layout above +#define RST_PIN 9 // +#define SS_PIN 10 // MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance diff --git a/examples/RFID-Cloner/RFID-Cloner.ino b/examples/RFID-Cloner/RFID-Cloner.ino index 95985e2..9b9e8bd 100644 --- a/examples/RFID-Cloner/RFID-Cloner.ino +++ b/examples/RFID-Cloner/RFID-Cloner.ino @@ -23,8 +23,8 @@ #include #include -constexpr uint8_t RST_PIN = 9; // Configurable, see typical pin layout above -constexpr uint8_t SS_PIN = 10; // Configurable, see typical pin layout above +#define RST_PIN 9 // Configurable, see typical pin layout above +#define SS_PIN 10 // Configurable, see typical pin layout above MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance. @@ -37,7 +37,7 @@ MFRC522::MIFARE_Key key; // Number of known default keys (hard-coded) // NOTE: Synchronize the NR_KNOWN_KEYS define with the defaultKeys[] array -constexpr uint8_t NR_KNOWN_KEYS = 8; +#define NR_KNOWN_KEYS 8 // Known keys, see: https://code.google.com/p/mfcuk/wiki/MifareClassicDefaultKeys byte knownKeys[NR_KNOWN_KEYS][MFRC522::MF_KEY_SIZE] = { {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, // FF FF FF FF FF FF = factory default diff --git a/examples/ReadAndWrite/ReadAndWrite.ino b/examples/ReadAndWrite/ReadAndWrite.ino index 09f1a4b..af95160 100644 --- a/examples/ReadAndWrite/ReadAndWrite.ino +++ b/examples/ReadAndWrite/ReadAndWrite.ino @@ -30,8 +30,8 @@ #include #include -constexpr uint8_t RST_PIN = 9; // Configurable, see typical pin layout above -constexpr uint8_t SS_PIN = 10; // Configurable, see typical pin layout above +#define RST_PIN 9 // Configurable, see typical pin layout above +#define SS_PIN 10 // Configurable, see typical pin layout above MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance. diff --git a/examples/ReadNUID/ReadNUID.ino b/examples/ReadNUID/ReadNUID.ino index da33211..9ff99da 100644 --- a/examples/ReadNUID/ReadNUID.ino +++ b/examples/ReadNUID/ReadNUID.ino @@ -31,8 +31,8 @@ #include #include -constexpr uint8_t RST_PIN = 9; // Configurable, see typical pin layout above -constexpr uint8_t SS_PIN = 10; // Configurable, see typical pin layout above +#define SS_PIN 10 +#define RST_PIN 9 MFRC522 rfid(SS_PIN, RST_PIN); // Instance of the class diff --git a/examples/ReadUidMultiReader/ReadUidMultiReader.ino b/examples/ReadUidMultiReader/ReadUidMultiReader.ino index 1ee53d3..c14c17a 100644 --- a/examples/ReadUidMultiReader/ReadUidMultiReader.ino +++ b/examples/ReadUidMultiReader/ReadUidMultiReader.ino @@ -30,11 +30,11 @@ #include #include -constexpr uint8_t RST_PIN = 9; // Configurable, see typical pin layout above -constexpr uint8_t SS_1_PIN = 10; // Configurable, take a unused pin, only HIGH/LOW required, must be diffrent to SS 2 -constexpr uint8_t SS_2_PIN = 8; // Configurable, take a unused pin, only HIGH/LOW required, must be diffrent to SS 1 +#define RST_PIN 9 // Configurable, see typical pin layout above +#define SS_1_PIN 10 // Configurable, take a unused pin, only HIGH/LOW required, must be diffrent to SS 2 +#define SS_2_PIN 8 // Configurable, take a unused pin, only HIGH/LOW required, must be diffrent to SS 1 -constexpr uint8_t NR_OF_READERS = 2; +#define NR_OF_READERS 2 byte ssPins[] = {SS_1_PIN, SS_2_PIN}; diff --git a/examples/firmware_check/firmware_check.ino b/examples/firmware_check/firmware_check.ino index cfada37..943ce5b 100644 --- a/examples/firmware_check/firmware_check.ino +++ b/examples/firmware_check/firmware_check.ino @@ -27,8 +27,8 @@ #include #include -constexpr uint8_t RST_PIN = 9; // Configurable, see typical pin layout above -constexpr uint8_t SS_PIN = 10; // Configurable, see typical pin layout above +#define RST_PIN 9 // Configurable, see typical pin layout above +#define SS_PIN 10 // Configurable, see typical pin layout above MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance diff --git a/examples/rfid_default_keys/rfid_default_keys.ino b/examples/rfid_default_keys/rfid_default_keys.ino index dd4b5f4..8f3ea56 100644 --- a/examples/rfid_default_keys/rfid_default_keys.ino +++ b/examples/rfid_default_keys/rfid_default_keys.ino @@ -28,14 +28,14 @@ #include #include -constexpr uint8_t RST_PIN = 9; // Configurable, see typical pin layout above -constexpr uint8_t SS_PIN = 10; // Configurable, see typical pin layout above +#define RST_PIN 9 // Configurable, see typical pin layout above +#define SS_PIN 10 // Configurable, see typical pin layout above MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance. // Number of known default keys (hard-coded) // NOTE: Synchronize the NR_KNOWN_KEYS define with the defaultKeys[] array -constexpr uint8_t NR_KNOWN_KEYS = 8; +#define NR_KNOWN_KEYS 8 // Known keys, see: https://code.google.com/p/mfcuk/wiki/MifareClassicDefaultKeys byte knownKeys[NR_KNOWN_KEYS][MFRC522::MF_KEY_SIZE] = { {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}, // FF FF FF FF FF FF = factory default diff --git a/examples/rfid_read_personal_data/rfid_read_personal_data.ino b/examples/rfid_read_personal_data/rfid_read_personal_data.ino index a302b45..5271cd1 100644 --- a/examples/rfid_read_personal_data/rfid_read_personal_data.ino +++ b/examples/rfid_read_personal_data/rfid_read_personal_data.ino @@ -22,8 +22,8 @@ #include #include -constexpr uint8_t RST_PIN = 9; // Configurable, see typical pin layout above -constexpr uint8_t SS_PIN = 10; // Configurable, see typical pin layout above +#define RST_PIN 9 // Configurable, see typical pin layout above +#define SS_PIN 10 // Configurable, see typical pin layout above MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance diff --git a/examples/rfid_write_personal_data/rfid_write_personal_data.ino b/examples/rfid_write_personal_data/rfid_write_personal_data.ino index 72903d7..75bb2fb 100644 --- a/examples/rfid_write_personal_data/rfid_write_personal_data.ino +++ b/examples/rfid_write_personal_data/rfid_write_personal_data.ino @@ -22,8 +22,8 @@ #include #include -constexpr uint8_t RST_PIN = 9; // Configurable, see typical pin layout above -constexpr uint8_t SS_PIN = 10; // Configurable, see typical pin layout above +#define RST_PIN 9 // Configurable, see typical pin layout above +#define SS_PIN 10 // Configurable, see typical pin layout above MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance