code ;
#include <SPI.h>
#include <MFRC522.h>
#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
void setup() {
Serial.begin(9600); // Initialize serial communications with the PC
while (!Serial); // Do nothing if no serial port is opened (added for Arduinos based on ATMEGA32U4)
SPI.begin(); // Init SPI bus
mfrc522.PCD_Init(); // Init MFRC522
delay(4); // Optional delay. Some board do need more time after init to be ready, see Readme
mfrc522.PCD_DumpVersionToSerial(); // Show details of PCD - MFRC522 Card Reader details
Serial.println(F("Scan PICC to see UID, SAK, type, and data blocks..."));
}
void loop() {
// Reset the loop if no new card present on the sensor/reader. This saves the entire process when idle.
if ( ! mfrc522.PICC_IsNewCardPresent()) {
return;
}
// Select one of the cards
if ( ! mfrc522.PICC_ReadCardSerial()) {
return;
}
// Dump debug info about the card; PICC_HaltA() is automatically called
mfrc522.PICC_DumpToSerial(&(mfrc522.uid));
}
Mess erreur ;
In file included from C:\electronique\arduino-1.7.8\Arduino\libraries\rfid-master\src/MFRC522.h:13:0,
from sketch_mar22c.ino:2:
C:\electronique\arduino-1.7.8\Arduino\libraries\rfid-master\src/require_cpp11.h:9:2: error: #error "This library needs at least a C++11 compliant compiler, maybe compiler argument for C++11 support is missing or if you use Arduino IDE upgrade to version >=1.6.6"
#error "This library needs at least a C++11 compliant compiler, maybe compiler argument for C++11 support is missing or if you use Arduino IDE upgrade to version >=1.6.6"
^
In file included from sketch_mar22c.ino:2:0:
C:\electronique\arduino-1.7.8\Arduino\libraries\rfid-master\src/MFRC522.h:81:9: error: 'constexpr' does not name a type
static constexpr byte FIFO_SIZE = 64; // The FIFO is 64 bytes.
^
C:\electronique\arduino-1.7.8\Arduino\libraries\rfid-master\src/MFRC522.h:81:9: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11
C:\electronique\arduino-1.7.8\Arduino\libraries\rfid-master\src/MFRC522.h:83:9: error: 'constexpr' does not name a type
static constexpr uint8_t UNUSED_PIN = UINT8_MAX;
^
C:\electronique\arduino-1.7.8\Arduino\libraries\rfid-master\src/MFRC522.h:83:9: note: C++11 'constexpr' only available with -std=c++11 or -std=gnu++11
In file included from sketch_mar22c.ino:2:0:
C:\electronique\arduino-1.7.8\Arduino\libraries\rfid-master\src/MFRC522.h:309:111: error: 'nullptr' was not declared in this scope
StatusCode PCD_TransceiveData(byte *sendData, byte sendLen, byte *backData, byte *backLen, byte *validBits = nullptr, byte rxAlign = 0, bool checkCRC = false);
^
C:\electronique\arduino-1.7.8\Arduino\libraries\rfid-master\src/MFRC522.h:310:112: error: 'nullptr' was not declared in this scope
StatusCode PCD_CommunicateWithPICC(byte command, byte waitIRq, byte *sendData, byte sendLen, byte *backData = nullptr, byte *backLen = nullptr, byte *validBits = nullptr, byte rxAlign = 0, bool checkCRC = false);
^
C:\electronique\arduino-1.7.8\Arduino\libraries\rfid-master\src/MFRC522.h:310:137: error: 'nullptr' was not declared in this scope
StatusCode PCD_CommunicateWithPICC(byte command, byte waitIRq, byte *sendData, byte sendLen, byte *backData = nullptr, byte *backLen = nullptr, byte *validBits = nullptr, byte rxAlign = 0, bool checkCRC = false);
^
C:\electronique\arduino-1.7.8\Arduino\libraries\rfid-master\src/MFRC522.h:310:164: error: 'nullptr' was not declared in this scope
StatusCode PCD_CommunicateWithPICC(byte command, byte waitIRq, byte *sendData, byte sendLen, byte *backData = nullptr, byte *backLen = nullptr, byte *validBits = nullptr, byte rxAlign = 0, bool checkCRC = false);