DFRobot_MCP23017 error using nano esp32

Hello! I'm using the library DFRobot_MCP23017.h on NANO ESP32 board and i have trouble in compile.

Below you can see the output:

In file included from C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:2:
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:127:27: error: expected ')' before '&' token
DFRobot_MCP23017(TwoWire &wire = Wire, uint8_t addr = 0x27);
~ ^~
)
In file included from C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/Arduino.h:223,
from C:\Users\STERGIOS\AppData\Local\Temp\arduino\sketches\B8181C72A8CE2F11A73E666B827C4C2F\sketch\MCP23017_DfR_Test_1.ino.cpp:1:
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:61: error: 'digitalPinToGPIONumber' is not a type
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
^~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:145:7: note: in expansion of macro 'pinMode'
int pinMode(ePin_t pin, uint8_t mode);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:46:66: error: 'digitalPinToGPIONumber' is not a type
#define digitalWrite(pin, val) digitalWrite(digitalPinToGPIONumber(pin), val)
^~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:154:7: note: in expansion of macro 'digitalWrite'
int digitalWrite(ePin_t pin, uint8_t level);
^~~~~~~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:42:65: error: 'digitalPinToGPIONumber' is not a type
#define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin))
^~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:162:7: note: in expansion of macro 'digitalRead'
int digitalRead(ePin_t pin);
^~~~~~~~~~~
In file included from C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:2:
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:299:3: error: 'TwoWire' does not name a type; did you mean 'TwoWire_h'?
TwoWire *_pWire;
^~~~~~~
TwoWire_h
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:19:22: error: 'Wire' was not declared in this scope
DFRobot_MCP23017 mcp(Wire, /*addr =*/0x20);//constructor, change the Level of A2, A1, A0 via DIP switch to revise the I2C address within 0x20~0x27.
^~~~
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:19:22: note: suggested alternative: 'pipe'
DFRobot_MCP23017 mcp(Wire, /*addr =*/0x20);//constructor, change the Level of A2, A1, A0 via DIP switch to revise the I2C address within 0x20~0x27.
^~~~
pipe
In file included from C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/Arduino.h:223,
from C:\Users\STERGIOS\AppData\Local\Temp\arduino\sketches\B8181C72A8CE2F11A73E666B827C4C2F\sketch\MCP23017_DfR_Test_1.ino.cpp:1:
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino: In function 'void setup()':
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:83: error: invalid conversion from 'int8_t' {aka 'signed char'} to 'int (*)(DFRobot_MCP23017::ePin_t)' [-fpermissive]
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
~~~~~~~~~~~~~~~~~~~~~~^~~~~
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:39:7: note: in expansion of macro 'pinMode'
mcp.pinMode(/*pin = */mcp.eGPA0, /*mode = */INPUT_PULLUP);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:61: note: initializing argument 1 of 'int DFRobot_MCP23017::pinMode(int (*)(DFRobot_MCP23017::ePin_t), uint8_t)'
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:145:7: note: in expansion of macro 'pinMode'
int pinMode(ePin_t pin, uint8_t mode);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:83: error: invalid conversion from 'int8_t' {aka 'signed char'} to 'int (*)(DFRobot_MCP23017::ePin_t)' [-fpermissive]
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
~~~~~~~~~~~~~~~~~~~~~~^~~~~
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:40:7: note: in expansion of macro 'pinMode'
mcp.pinMode(/*pin = */mcp.eGPA1, /*mode = */INPUT_PULLUP);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:61: note: initializing argument 1 of 'int DFRobot_MCP23017::pinMode(int (*)(DFRobot_MCP23017::ePin_t), uint8_t)'
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:145:7: note: in expansion of macro 'pinMode'
int pinMode(ePin_t pin, uint8_t mode);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:83: error: invalid conversion from 'int8_t' {aka 'signed char'} to 'int (*)(DFRobot_MCP23017::ePin_t)' [-fpermissive]
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
~~~~~~~~~~~~~~~~~~~~~~^~~~~
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:41:7: note: in expansion of macro 'pinMode'
mcp.pinMode(/*pin = */mcp.eGPA2, /*mode = */INPUT_PULLUP);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:61: note: initializing argument 1 of 'int DFRobot_MCP23017::pinMode(int (*)(DFRobot_MCP23017::ePin_t), uint8_t)'
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:145:7: note: in expansion of macro 'pinMode'
int pinMode(ePin_t pin, uint8_t mode);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:83: error: invalid conversion from 'int8_t' {aka 'signed char'} to 'int (*)(DFRobot_MCP23017::ePin_t)' [-fpermissive]
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
~~~~~~~~~~~~~~~~~~~~~~^~~~~
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:42:7: note: in expansion of macro 'pinMode'
mcp.pinMode(/*pin = */mcp.eGPB7, /*mode = */INPUT_PULLUP);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:61: note: initializing argument 1 of 'int DFRobot_MCP23017::pinMode(int (*)(DFRobot_MCP23017::ePin_t), uint8_t)'
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:145:7: note: in expansion of macro 'pinMode'
int pinMode(ePin_t pin, uint8_t mode);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:83: error: invalid conversion from 'int8_t' {aka 'signed char'} to 'int (*)(DFRobot_MCP23017::ePin_t)' [-fpermissive]
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
~~~~~~~~~~~~~~~~~~~~~~^~~~~
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:43:7: note: in expansion of macro 'pinMode'
mcp.pinMode(/*pin = */mcp.eGPA4, /*mode = */INPUT_PULLUP);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:61: note: initializing argument 1 of 'int DFRobot_MCP23017::pinMode(int (*)(DFRobot_MCP23017::ePin_t), uint8_t)'
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:145:7: note: in expansion of macro 'pinMode'
int pinMode(ePin_t pin, uint8_t mode);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:83: error: invalid conversion from 'int8_t' {aka 'signed char'} to 'int (*)(DFRobot_MCP23017::ePin_t)' [-fpermissive]
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
~~~~~~~~~~~~~~~~~~~~~~^~~~~
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:44:7: note: in expansion of macro 'pinMode'
mcp.pinMode(/*pin = */mcp.eGPB6, /*mode = */INPUT_PULLUP);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:61: note: initializing argument 1 of 'int DFRobot_MCP23017::pinMode(int (*)(DFRobot_MCP23017::ePin_t), uint8_t)'
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:145:7: note: in expansion of macro 'pinMode'
int pinMode(ePin_t pin, uint8_t mode);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:83: error: invalid conversion from 'int8_t' {aka 'signed char'} to 'int (*)(DFRobot_MCP23017::ePin_t)' [-fpermissive]
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
~~~~~~~~~~~~~~~~~~~~~~^~~~~
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:45:7: note: in expansion of macro 'pinMode'
mcp.pinMode(/*pin = */mcp.eGPB5, /*mode = */INPUT_PULLUP);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:61: note: initializing argument 1 of 'int DFRobot_MCP23017::pinMode(int (*)(DFRobot_MCP23017::ePin_t), uint8_t)'
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:145:7: note: in expansion of macro 'pinMode'
int pinMode(ePin_t pin, uint8_t mode);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:83: error: invalid conversion from 'int8_t' {aka 'signed char'} to 'int (*)(DFRobot_MCP23017::ePin_t)' [-fpermissive]
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
~~~~~~~~~~~~~~~~~~~~~~^~~~~
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:46:7: note: in expansion of macro 'pinMode'
mcp.pinMode(/*pin = */mcp.eGPB4, /*mode = */INPUT_PULLUP);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:61: note: initializing argument 1 of 'int DFRobot_MCP23017::pinMode(int (*)(DFRobot_MCP23017::ePin_t), uint8_t)'
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:145:7: note: in expansion of macro 'pinMode'
int pinMode(ePin_t pin, uint8_t mode);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:83: error: invalid conversion from 'int8_t' {aka 'signed char'} to 'int (*)(DFRobot_MCP23017::ePin_t)' [-fpermissive]
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
~~~~~~~~~~~~~~~~~~~~~~^~~~~
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:47:7: note: in expansion of macro 'pinMode'
mcp.pinMode(/*pin = */mcp.eGPB3, /*mode = */INPUT_PULLUP);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:61: note: initializing argument 1 of 'int DFRobot_MCP23017::pinMode(int (*)(DFRobot_MCP23017::ePin_t), uint8_t)'
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:145:7: note: in expansion of macro 'pinMode'
int pinMode(ePin_t pin, uint8_t mode);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:83: error: invalid conversion from 'int8_t' {aka 'signed char'} to 'int (*)(DFRobot_MCP23017::ePin_t)' [-fpermissive]
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
~~~~~~~~~~~~~~~~~~~~~~^~~~~
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:48:7: note: in expansion of macro 'pinMode'
mcp.pinMode(/*pin = */mcp.eGPB2, /*mode = */INPUT_PULLUP);
^~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:47:61: note: initializing argument 1 of 'int DFRobot_MCP23017::pinMode(int (*)(DFRobot_MCP23017::ePin_t), uint8_t)'
#define pinMode(pin, mode) pinMode(digitalPinToGPIONumber(pin), mode)
^~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:145:7: note: in expansion of macro 'pinMode'
int pinMode(ePin_t pin, uint8_t mode);
^~~~~~~
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino: In function 'void loop()':
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:42:87: error: invalid conversion from 'int8_t' {aka 'signed char'} to 'int (*)(DFRobot_MCP23017::ePin_t)' [-fpermissive]
#define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin))
~~~~~~~~~~~~~~~~~~~~~~^~~~~
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:69:24: note: in expansion of macro 'digitalRead'
uint8_t value1 = mcp.digitalRead(/*pin = */mcp.eGPB7);
^~~~~~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:42:65: note: initializing argument 1 of 'int DFRobot_MCP23017::digitalRead(int (*)(DFRobot_MCP23017::ePin_t))'
#define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin))
^~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:162:7: note: in expansion of macro 'digitalRead'
int digitalRead(ePin_t pin);
^~~~~~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:42:87: error: invalid conversion from 'int8_t' {aka 'signed char'} to 'int (*)(DFRobot_MCP23017::ePin_t)' [-fpermissive]
#define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin))
~~~~~~~~~~~~~~~~~~~~~~^~~~~
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:70:24: note: in expansion of macro 'digitalRead'
uint8_t value2 = mcp.digitalRead(/*pin = */mcp.eGPB6);
^~~~~~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:42:65: note: initializing argument 1 of 'int DFRobot_MCP23017::digitalRead(int (*)(DFRobot_MCP23017::ePin_t))'
#define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin))
^~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:162:7: note: in expansion of macro 'digitalRead'
int digitalRead(ePin_t pin);
^~~~~~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:42:87: error: invalid conversion from 'int8_t' {aka 'signed char'} to 'int (*)(DFRobot_MCP23017::ePin_t)' [-fpermissive]
#define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin))
~~~~~~~~~~~~~~~~~~~~~~^~~~~
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:71:24: note: in expansion of macro 'digitalRead'
uint8_t value3 = mcp.digitalRead(/*pin = */mcp.eGPB5);
^~~~~~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:42:65: note: initializing argument 1 of 'int DFRobot_MCP23017::digitalRead(int (*)(DFRobot_MCP23017::ePin_t))'
#define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin))
^~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:162:7: note: in expansion of macro 'digitalRead'
int digitalRead(ePin_t pin);
^~~~~~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:42:87: error: invalid conversion from 'int8_t' {aka 'signed char'} to 'int (*)(DFRobot_MCP23017::ePin_t)' [-fpermissive]
#define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin))
~~~~~~~~~~~~~~~~~~~~~~^~~~~
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:72:24: note: in expansion of macro 'digitalRead'
uint8_t value4 = mcp.digitalRead(/*pin = */mcp.eGPB4);
^~~~~~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:42:65: note: initializing argument 1 of 'int DFRobot_MCP23017::digitalRead(int (*)(DFRobot_MCP23017::ePin_t))'
#define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin))
^~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:162:7: note: in expansion of macro 'digitalRead'
int digitalRead(ePin_t pin);
^~~~~~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:42:87: error: invalid conversion from 'int8_t' {aka 'signed char'} to 'int (*)(DFRobot_MCP23017::ePin_t)' [-fpermissive]
#define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin))
~~~~~~~~~~~~~~~~~~~~~~^~~~~
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:73:24: note: in expansion of macro 'digitalRead'
uint8_t value5 = mcp.digitalRead(/*pin = */mcp.eGPB3);
^~~~~~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:42:65: note: initializing argument 1 of 'int DFRobot_MCP23017::digitalRead(int (*)(DFRobot_MCP23017::ePin_t))'
#define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin))
^~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:162:7: note: in expansion of macro 'digitalRead'
int digitalRead(ePin_t pin);
^~~~~~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:42:87: error: invalid conversion from 'int8_t' {aka 'signed char'} to 'int (*)(DFRobot_MCP23017::ePin_t)' [-fpermissive]
#define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin))
~~~~~~~~~~~~~~~~~~~~~~^~~~~
C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:74:24: note: in expansion of macro 'digitalRead'
uint8_t value6 = mcp.digitalRead(/*pin = */mcp.eGPB2);
^~~~~~~~~~~
C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\cores\esp32/io_pin_remap.h:42:65: note: initializing argument 1 of 'int DFRobot_MCP23017::digitalRead(int (*)(DFRobot_MCP23017::ePin_t))'
#define digitalRead(pin) digitalRead(digitalPinToGPIONumber(pin))
^~~~~~~~~~~~~~~~~~~~~~~~~~~
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:162:7: note: in expansion of macro 'digitalRead'
int digitalRead(ePin_t pin);
^~~~~~~~~~~
Multiple libraries were found for "Wire.h"
Used: C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\libraries\Wire
Not used: C:\Users\STERGIOS\Documents\Arduino\libraries\Wire
Using library DFRobot_MCP23017 at version 1.0.0 in folder: C:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master
Using library Wire at version 2.0.0 in folder: C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\libraries\Wire
exit status 1

Compilation error: 'Wire' was not declared in this scope

Any help would be greatly appreciated

Hi @StergiosT. Please post your full sketch.

I'll provide instructions you can follow to do that:

  1. Select Tools > Auto Format from the Arduino IDE menus.
    ⓘ This is done to make the code easier for us to read.
  2. Select Edit > Copy for Forum (Markdown) from the Arduino IDE menus.
  3. In a forum reply here, click on the post composer field.
  4. Press the Ctrl+V keyboard shortcut.
    This will paste the sketch to the post composer.
  5. Move the cursor outside of the code block markup before you add any additional text to your reply.
  6. Repeat the above process if your sketch has multiple tabs.
  7. Click the "Reply" button to post your reply.

When your code requires a library that's not included with the Arduino IDE please post a link to where you downloaded that library from, or if you installed it using Library Manager (Sketch > Include Library > Manage Libraries... in Arduino IDE) then say so and state the full name of the library.


#include <DFRobot_MCP23017.h>

/*DFRobot_MCP23017 constructor
  Parameter&wire Wire
  Parameter addr  I2C address can be select from 0x20~0x27; the relationship of DIP switch(A2, A1, A0) and I2C address(0x27) is
  shown below:
    0  0  1  0  | 0  A2 A1 A0
    0  0  1  0  | 0  1  1  1    0x27
    0  0  1  0  | 0  1  1  0    0x26
    0  0  1  0  | 0  1  0  1    0x25
    0  0  1  0  | 0  1  0  0    0x24
    0  0  1  0  | 0  0  1  1    0x23
    0  0  1  0  | 0  0  1  0    0x22
    0  0  1  0  | 0  0  0  1    0x21
    0  0  1  0  | 0  0  0  0    0x205
*/

DFRobot_MCP23017 mcp(Wire, /*addr =*/0x20);//constructor, change the Level of A2, A1, A0 via DIP switch to revise the I2C address within 0x20~0x27.

//DFRobot_MCP23017 mcp;//use default parameter, Wire  0x27(default I2C address)

//Prepare: connect a button to a digital pin of the IO expansion board(eg: eGPA0)
void setup() {
  Serial.begin(115200);
  /*wait for the chip to be initialized completely, and then exit*/
  while (mcp.begin() != 0) {
    Serial.println("Initialization of the chip failed, please confirm that the chip connection is correct!");
    delay(1000);
  }
  /*pinMode function is used to set the pin mode of module
    Parameter pin, the available parameter is shown below:
    eGPA0  eGPA1  eGPA2  eGPA3  eGPA4  eGPA5  eGPA6  eGPA7  eGPA
    0       1      2      3      4      5      6      7
    eGPB0  eGPB1  eGPB2  eGPB3  eGPB4  eGPB5  eGPB6  eGPB7  eGPB
    8       9      10     11     12     13     14     15
    Parameter mode, can be set to: INPUT, OUTPUT, INPUT_PULLUP(internal 100KΩ pull-up resistor)
  */
  mcp.pinMode(/*pin = */mcp.eGPA0, /*mode = */INPUT_PULLUP);
  mcp.pinMode(/*pin = */mcp.eGPA1, /*mode = */INPUT_PULLUP);
  mcp.pinMode(/*pin = */mcp.eGPA2, /*mode = */INPUT_PULLUP);
  mcp.pinMode(/*pin = */mcp.eGPB7, /*mode = */INPUT_PULLUP);
  mcp.pinMode(/*pin = */mcp.eGPA4, /*mode = */INPUT_PULLUP);
  mcp.pinMode(/*pin = */mcp.eGPB6, /*mode = */INPUT_PULLUP);
  mcp.pinMode(/*pin = */mcp.eGPB5, /*mode = */INPUT_PULLUP);
  mcp.pinMode(/*pin = */mcp.eGPB4, /*mode = */INPUT_PULLUP);
  mcp.pinMode(/*pin = */mcp.eGPB3, /*mode = */INPUT_PULLUP);
  mcp.pinMode(/*pin = */mcp.eGPB2, /*mode = */INPUT_PULLUP);

  /*Set all Group GPIOA pins to input*/
  //mcp.pinMode(/*pin = */mcp.eGPA, /*mode = */INPUT);
}

void loop() {
  /*digitalRead function is used to read the Level of a digital pin. The pin needs to be set to input mode before using this function.
    Parameter pin, the available parameter is shown below:
    eGPA0  eGPA1  eGPA2  eGPA3  eGPA4  eGPA5  eGPA6  eGPA7  eGPA
    0       1      2      3      4      5      6      7
    eGPB0  eGPB1  eGPB2  eGPB3  eGPB4  eGPB5  eGPB6  eGPB7  eGPB
    8       9      10     11     12     13     14     15
  */
  //  uint8_t value1 = mcp.digitalRead(/*pin = */mcp.eGPA0);
  //  uint8_t value2 = mcp.digitalRead(/*pin = */mcp.eGPA1);
  //  uint8_t value3 = mcp.digitalRead(/*pin = */mcp.eGPA2);
  //  uint8_t value4 = mcp.digitalRead(/*pin = */mcp.eGPB7);
  //  uint8_t value5 = mcp.digitalRead(/*pin = */mcp.eGPA4);


  uint8_t value1 = mcp.digitalRead(/*pin = */mcp.eGPB7);
  uint8_t value2 = mcp.digitalRead(/*pin = */mcp.eGPB6);
  uint8_t value3 = mcp.digitalRead(/*pin = */mcp.eGPB5);
  uint8_t value4 = mcp.digitalRead(/*pin = */mcp.eGPB4);
  uint8_t value5 = mcp.digitalRead(/*pin = */mcp.eGPB3);
  uint8_t value6 = mcp.digitalRead(/*pin = */mcp.eGPB2);


  /*Read  level of Group GPIOA pins*/
  //value = mcp.digitalRead(/*pin = */mcp.eGPA);
  if (value1) {
    //Serial.println("Button press!");
    //delay(200);
  } else {
    //Serial.println("Button release!");
  }


  Serial.print("IN1: ");  Serial.print(value1); Serial.print("\t");
  Serial.print("IN2: ");  Serial.print(value2); Serial.print("\t");
  Serial.print("IN3: ");  Serial.print(value3); Serial.print("\t");
  Serial.print("IN4: ");  Serial.print(value4); Serial.print("\t");
  Serial.print("IN5: ");  Serial.print(value5); Serial.print("\t");
  Serial.print("IN6: ");  Serial.println(value6);


  delay(200);
}```

Select Tools > Pin Numbering > By GPIO number (legacy) from the Arduino IDE menus and then try compiling the sketch again.

Is the compilation successful this time? It was when I tried it.

Thanks for the reply,
Using GPIO number (legacy) most of the errors gone. Current output is the following:

In file included from C:\Users\STERGIOS\Desktop\MCP23017_DfR_Test_1\MCP23017_DfR_Test_1.ino:2:
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:126:27: error: expected ')' before '&' token
   DFRobot_MCP23017(TwoWire &wire = Wire, uint8_t addr = 0x27);
                   ~       ^~
                           )
c:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master/DFRobot_MCP23017.h:297:3: error: 'TwoWire' does not name a type; did you mean 'TwoWire_h'?
   TwoWire *_pWire;
   ^~~~~~~
   TwoWire_h

Using library DFRobot_MCP23017 at version 1.0.0 in folder: C:\Users\STERGIOS\Documents\Arduino\libraries\DFRobot_MCP23017-master 
Using library Wire at version 2.0.0 in folder: C:\Users\STERGIOS\AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\libraries\Wire 
exit status 1

Finally i figured out and it compile successful,
I delete wire. h and wire.cpp at localtion: AppData\Local\Arduino15\packages\arduino\hardware\esp32\2.0.13\libraries\Wire

Thanks for your help!

You are welcome. I'm glad it is working now.

Regards,
Per