Hi guys!
Could you explain how to correct the error? Here is the code (sorry that without comments):
#include <MFRC522.h>
#include <SPI.h>
#define MAX_SS 2
int SS_PIN[MAX_SS] = {10, 6};
int RST_PIN[MAX_SS] = {9, 5};
MFRC522 *mfrc522[MAX_SS];
void setup() {
for (byte i = 0; i < MAX_SS; i++) mfrc522[i] = new mfrc522(SS_PIN[i], RST_PIN[i]);
Serial.begin(9600);
SPI.begin();
for (int i = 0; i < MAX_SS; i++) mfrc522[i]->PCD_Init();
}
void loop() {
for (byte i = 0; i < MAX_SS; i++){
if ( ! mfrc522[i]->PICC_IsNewCardPresent()) {
return;
}}
for (byte i = 0; i < MAX_SS; i++){
if ( ! mfrc522[i]->PICC_ReadCardSerial()) {
return;
}}
for (byte i = 0; i < MAX_SS; i++){
mfrc522[i]->PICC_DumpToSerial(&(mfrc522[i]->uid));
}}
and here is the error:
expected type-specifier before 'mfrc522' (I think that something wrong with 'new').
Sorry for my english)