Skip to main content
Commonmark migration
Source Link

I was looking at this link on RFID I2C interface. I added the library to arduino, but in main.cpp, I see an error:

In function 'void setup()':

 

sketch_mar27a:16: error: no matching function for call to 'TwoWire::begin(int, int)'

 

Wire.begin(SDA_PIN, SCL_PIN); // Initialize I2C

I looked at Wire.cpp file and found that there is no such member function overloaded with two parameters.

How should I fix the problem? Even if I fix this one problem, I am not sure if this code is working code.

Where can I find working code with I2C interface? I have resource problem and SPI PORT cannot be used.

The code:

#include <Wire.h>

#include "MFRC522_I2C.h"

#define SDA_PIN 5
#define SCL_PIN 6
#define RST_PIN 3

MFRC522 mfrc522(0x28, RST_PIN);  // Create MFRC522 instance.

void ShowReaderDetails();

void setup() {
  Serial.begin(9600); // Initialize serial communications with the PC
  Wire.begin(SDA_PIN, SCL_PIN); // Initialize I2C
  mfrc522.PCD_Init();   // Init MFRC522
  ShowReaderDetails();  // Show details of PCD - MFRC522 Card Reader details
  Serial.println(F("Scan PICC to see UID, type, and data blocks..."));
}

void loop() {
  // Look for new cards
  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));
}

void ShowReaderDetails() {
  // Get the MFRC522 software version
  byte v = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);
  Serial.print(F("MFRC522 Software Version: 0x"));
  Serial.print(v, HEX);
  if (v == 0x91)
    Serial.print(F(" = v1.0"));
  else if (v == 0x92)
    Serial.print(F(" = v2.0"));
  else
    Serial.print(F(" (unknown)"));
  Serial.println("");
  // When 0x00 or 0xFF is returned, communication probably failed
  if ((v == 0x00) || (v == 0xFF)) {
    Serial.println(F("WARNING: Communication failure, is the MFRC522 properly connected?"));
  }
}

I was looking at this link on RFID I2C interface. I added the library to arduino, but in main.cpp, I see an error:

In function 'void setup()':

 

sketch_mar27a:16: error: no matching function for call to 'TwoWire::begin(int, int)'

 

Wire.begin(SDA_PIN, SCL_PIN); // Initialize I2C

I looked at Wire.cpp file and found that there is no such member function overloaded with two parameters.

How should I fix the problem? Even if I fix this one problem, I am not sure if this code is working code.

Where can I find working code with I2C interface? I have resource problem and SPI PORT cannot be used.

The code:

#include <Wire.h>

#include "MFRC522_I2C.h"

#define SDA_PIN 5
#define SCL_PIN 6
#define RST_PIN 3

MFRC522 mfrc522(0x28, RST_PIN);  // Create MFRC522 instance.

void ShowReaderDetails();

void setup() {
  Serial.begin(9600); // Initialize serial communications with the PC
  Wire.begin(SDA_PIN, SCL_PIN); // Initialize I2C
  mfrc522.PCD_Init();   // Init MFRC522
  ShowReaderDetails();  // Show details of PCD - MFRC522 Card Reader details
  Serial.println(F("Scan PICC to see UID, type, and data blocks..."));
}

void loop() {
  // Look for new cards
  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));
}

void ShowReaderDetails() {
  // Get the MFRC522 software version
  byte v = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);
  Serial.print(F("MFRC522 Software Version: 0x"));
  Serial.print(v, HEX);
  if (v == 0x91)
    Serial.print(F(" = v1.0"));
  else if (v == 0x92)
    Serial.print(F(" = v2.0"));
  else
    Serial.print(F(" (unknown)"));
  Serial.println("");
  // When 0x00 or 0xFF is returned, communication probably failed
  if ((v == 0x00) || (v == 0xFF)) {
    Serial.println(F("WARNING: Communication failure, is the MFRC522 properly connected?"));
  }
}

I was looking at this link on RFID I2C interface. I added the library to arduino, but in main.cpp, I see an error:

In function 'void setup()':

sketch_mar27a:16: error: no matching function for call to 'TwoWire::begin(int, int)'

Wire.begin(SDA_PIN, SCL_PIN); // Initialize I2C

I looked at Wire.cpp file and found that there is no such member function overloaded with two parameters.

How should I fix the problem? Even if I fix this one problem, I am not sure if this code is working code.

Where can I find working code with I2C interface? I have resource problem and SPI PORT cannot be used.

The code:

#include <Wire.h>

#include "MFRC522_I2C.h"

#define SDA_PIN 5
#define SCL_PIN 6
#define RST_PIN 3

MFRC522 mfrc522(0x28, RST_PIN);  // Create MFRC522 instance.

void ShowReaderDetails();

void setup() {
  Serial.begin(9600); // Initialize serial communications with the PC
  Wire.begin(SDA_PIN, SCL_PIN); // Initialize I2C
  mfrc522.PCD_Init();   // Init MFRC522
  ShowReaderDetails();  // Show details of PCD - MFRC522 Card Reader details
  Serial.println(F("Scan PICC to see UID, type, and data blocks..."));
}

void loop() {
  // Look for new cards
  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));
}

void ShowReaderDetails() {
  // Get the MFRC522 software version
  byte v = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);
  Serial.print(F("MFRC522 Software Version: 0x"));
  Serial.print(v, HEX);
  if (v == 0x91)
    Serial.print(F(" = v1.0"));
  else if (v == 0x92)
    Serial.print(F(" = v2.0"));
  else
    Serial.print(F(" (unknown)"));
  Serial.println("");
  // When 0x00 or 0xFF is returned, communication probably failed
  if ((v == 0x00) || (v == 0xFF)) {
    Serial.println(F("WARNING: Communication failure, is the MFRC522 properly connected?"));
  }
}
Question Protected by VE7JRO
Improved formatting.
Source Link
sa_leinad
  • 3.2k
  • 2
  • 24
  • 53

I was looking at this link on RFID I2C interface. I added the library to arduino, but in main.cppmain.cpp, I see an error:

In function 'void setup()':

In function 'void setup()':

sketch_mar27a:16: error: no matching function for call to 'TwoWire::begin(int, int)'

sketch_mar27a:16: error: no matching function for call to 'TwoWire::begin(int, int)'

Wire.begin(SDA_PIN, SCL_PIN); // Initialize I2C

Wire.begin(SDA_PIN, SCL_PIN); // Initialize I2C

I looked at Wire.cppWire.cpp file and found that there is no such member function overloaded with two parameters. 

How should I fix the problem? Even if I fix this one problem, I am not sure if this code is working code. Where

Where can I find working code with I2C interface? I have resource problem and SPI PORT cannot be used.

Edit (Code is added)The code:

I was looking at this link on RFID I2C interface. I added the library to arduino, but in main.cpp, I see an error:

In function 'void setup()':

sketch_mar27a:16: error: no matching function for call to 'TwoWire::begin(int, int)'

Wire.begin(SDA_PIN, SCL_PIN); // Initialize I2C

I looked at Wire.cpp file and found that there is no such member function overloaded with two parameters. How should I fix the problem? Even if I fix this one problem, I am not sure if this code is working code. Where can I find working code with I2C interface? I have resource problem and SPI PORT cannot be used.

Edit (Code is added):

I was looking at this link on RFID I2C interface. I added the library to arduino, but in main.cpp, I see an error:

In function 'void setup()':

sketch_mar27a:16: error: no matching function for call to 'TwoWire::begin(int, int)'

Wire.begin(SDA_PIN, SCL_PIN); // Initialize I2C

I looked at Wire.cpp file and found that there is no such member function overloaded with two parameters. 

How should I fix the problem? Even if I fix this one problem, I am not sure if this code is working code.

Where can I find working code with I2C interface? I have resource problem and SPI PORT cannot be used.

The code:

Added the sketch
Source Link
Rajesh
  • 171
  • 2
  • 7

I was looking at this link on RFID I2C interface. I added the library to arduino, but in main.cpp, I see an error:

In function 'void setup()':

sketch_mar27a:16: error: no matching function for call to 'TwoWire::begin(int, int)'

Wire.begin(SDA_PIN, SCL_PIN); // Initialize I2C

I looked at Wire.cpp file and found that there is no such member function overloaded with two parameters. How should I fix the problem? Even if I fix this one problem, I am not sure if this code is working code. Where can I find working code with I2C interface? I have resource problem and SPI PORT cannot be used.

Edit (Code is added):

#include <Wire.h>

#include "MFRC522_I2C.h"

#define SDA_PIN 5
#define SCL_PIN 6
#define RST_PIN 3

MFRC522 mfrc522(0x28, RST_PIN);  // Create MFRC522 instance.

void ShowReaderDetails();

void setup() {
  Serial.begin(9600); // Initialize serial communications with the PC
  Wire.begin(SDA_PIN, SCL_PIN); // Initialize I2C
  mfrc522.PCD_Init();   // Init MFRC522
  ShowReaderDetails();  // Show details of PCD - MFRC522 Card Reader details
  Serial.println(F("Scan PICC to see UID, type, and data blocks..."));
}

void loop() {
  // Look for new cards
  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));
}

void ShowReaderDetails() {
  // Get the MFRC522 software version
  byte v = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);
  Serial.print(F("MFRC522 Software Version: 0x"));
  Serial.print(v, HEX);
  if (v == 0x91)
    Serial.print(F(" = v1.0"));
  else if (v == 0x92)
    Serial.print(F(" = v2.0"));
  else
    Serial.print(F(" (unknown)"));
  Serial.println("");
  // When 0x00 or 0xFF is returned, communication probably failed
  if ((v == 0x00) || (v == 0xFF)) {
    Serial.println(F("WARNING: Communication failure, is the MFRC522 properly connected?"));
  }
}

I was looking at this link on RFID I2C interface. I added the library to arduino, but in main.cpp, I see an error:

In function 'void setup()':

sketch_mar27a:16: error: no matching function for call to 'TwoWire::begin(int, int)'

Wire.begin(SDA_PIN, SCL_PIN); // Initialize I2C

I looked at Wire.cpp file and found that there is no such member function overloaded with two parameters. How should I fix the problem? Even if I fix this one problem, I am not sure if this code is working code. Where can I find working code with I2C interface? I have resource problem and SPI PORT cannot be used.

I was looking at this link on RFID I2C interface. I added the library to arduino, but in main.cpp, I see an error:

In function 'void setup()':

sketch_mar27a:16: error: no matching function for call to 'TwoWire::begin(int, int)'

Wire.begin(SDA_PIN, SCL_PIN); // Initialize I2C

I looked at Wire.cpp file and found that there is no such member function overloaded with two parameters. How should I fix the problem? Even if I fix this one problem, I am not sure if this code is working code. Where can I find working code with I2C interface? I have resource problem and SPI PORT cannot be used.

Edit (Code is added):

#include <Wire.h>

#include "MFRC522_I2C.h"

#define SDA_PIN 5
#define SCL_PIN 6
#define RST_PIN 3

MFRC522 mfrc522(0x28, RST_PIN);  // Create MFRC522 instance.

void ShowReaderDetails();

void setup() {
  Serial.begin(9600); // Initialize serial communications with the PC
  Wire.begin(SDA_PIN, SCL_PIN); // Initialize I2C
  mfrc522.PCD_Init();   // Init MFRC522
  ShowReaderDetails();  // Show details of PCD - MFRC522 Card Reader details
  Serial.println(F("Scan PICC to see UID, type, and data blocks..."));
}

void loop() {
  // Look for new cards
  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));
}

void ShowReaderDetails() {
  // Get the MFRC522 software version
  byte v = mfrc522.PCD_ReadRegister(mfrc522.VersionReg);
  Serial.print(F("MFRC522 Software Version: 0x"));
  Serial.print(v, HEX);
  if (v == 0x91)
    Serial.print(F(" = v1.0"));
  else if (v == 0x92)
    Serial.print(F(" = v2.0"));
  else
    Serial.print(F(" (unknown)"));
  Serial.println("");
  // When 0x00 or 0xFF is returned, communication probably failed
  if ((v == 0x00) || (v == 0xFF)) {
    Serial.println(F("WARNING: Communication failure, is the MFRC522 properly connected?"));
  }
}
Source Link
Rajesh
  • 171
  • 2
  • 7
Loading