0

Here is the Code and the Error message, the code is just a testing file before I work with the code, and when I import just the Keypad.h and Keypad_I2C.h, It worked fine, also work when I only import ESP8266WiFi.h. When I tried only importing one of the Keypad lib and the ESP8266WiFi.h and the error occured.

Code:

#include <Keypad_I2C.h>
#include <Keypad.h>
//#include <ArduinoJson.h>
//#include<SoftwareSerial.h>
#include<ESP8266WiFi.h>
void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

Error Messages:

In file included from sketch\ImportTest.ino.cpp:1:0:

C:\Users\user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\cores\esp8266/Arduino.h:43:14: error: expected identifier before numeric constant

 #define HIGH 0x1

              ^

C:\Users\user\Documents\Arduino\libraries\Keypad\src/Keypad.h:56:16: note: in expansion of macro 'HIGH'

 #define CLOSED HIGH

                ^

C:\Users\user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/include/wl_definitions.h:73:3: note: in expansion of macro 'CLOSED'

   CLOSED      = 0,

   ^

C:\Users\user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\cores\esp8266/Arduino.h:43:14: error: expected '}' before numeric constant

 #define HIGH 0x1

              ^

C:\Users\user\Documents\Arduino\libraries\Keypad\src/Keypad.h:56:16: note: in expansion of macro 'HIGH'

 #define CLOSED HIGH

                ^

C:\Users\user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/include/wl_definitions.h:73:3: note: in expansion of macro 'CLOSED'

   CLOSED      = 0,

   ^

C:\Users\user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\cores\esp8266/Arduino.h:43:14: error: expected unqualified-id before numeric constant

 #define HIGH 0x1

              ^

C:\Users\user\Documents\Arduino\libraries\Keypad\src/Keypad.h:56:16: note: in expansion of macro 'HIGH'

 #define CLOSED HIGH

                ^

C:\Users\user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/include/wl_definitions.h:73:3: note: in expansion of macro 'CLOSED'

   CLOSED      = 0,

   ^

In file included from C:\Users\user\Documents\Arduino\ImportTest\ImportTest.ino:5:0:

C:\Users\user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/ESP8266WiFi.h:29:1: error: expected declaration before '}' token

 }

 ^

Multiple libraries were found for "Keypad_I2C.h"
 Used: C:\Users\user\Documents\Arduino\libraries\arduino_keypads-master
Multiple libraries were found for "Keypad.h"
 Used: C:\Users\user\Documents\Arduino\libraries\Keypad
Multiple libraries were found for "Wire.h"
 Used: C:\Users\user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\WireESP8266
Multiple libraries were found for "ESP8266WiFi.h"
 Used: C:\Users\user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).
Arduino: 1.8.10 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"

In file included from sketch\ImportTest.ino.cpp:1:0:

C:\Users\user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\cores\esp8266/Arduino.h:43:14: error: expected identifier before numeric constant

 #define HIGH 0x1

              ^

C:\Users\user\Documents\Arduino\libraries\Keypad\src/Keypad.h:56:16: note: in expansion of macro 'HIGH'

 #define CLOSED HIGH

                ^

C:\Users\user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/include/wl_definitions.h:73:3: note: in expansion of macro 'CLOSED'

   CLOSED      = 0,

   ^

C:\Users\user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\cores\esp8266/Arduino.h:43:14: error: expected '}' before numeric constant

 #define HIGH 0x1

              ^

C:\Users\user\Documents\Arduino\libraries\Keypad\src/Keypad.h:56:16: note: in expansion of macro 'HIGH'

 #define CLOSED HIGH

                ^

C:\Users\user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/include/wl_definitions.h:73:3: note: in expansion of macro 'CLOSED'

   CLOSED      = 0,

   ^

C:\Users\user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\cores\esp8266/Arduino.h:43:14: error: expected unqualified-id before numeric constant

 #define HIGH 0x1

              ^

C:\Users\user\Documents\Arduino\libraries\Keypad\src/Keypad.h:56:16: note: in expansion of macro 'HIGH'

 #define CLOSED HIGH

                ^

C:\Users\user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/include/wl_definitions.h:73:3: note: in expansion of macro 'CLOSED'

   CLOSED      = 0,

   ^

In file included from C:\Users\user\Documents\Arduino\ImportTest\ImportTest.ino:5:0:

C:\Users\user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi\src/ESP8266WiFi.h:29:1: error: expected declaration before '}' token

 }

 ^

Multiple libraries were found for "Keypad.h"
 Used: C:\Users\user\Documents\Arduino\libraries\Keypad
Multiple libraries were found for "ESP8266WiFi.h"
 Used: C:\Users\user\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
AOV Ezy
  • 55
  • 3
  • 10

1 Answers1

0

It's a known feature < /sarcasm> since 2017. Include the keypad libs as the last of the standard libs:

//#include <ArduinoJson.h>
//#include<SoftwareSerial.h>
#include<ESP8266WiFi.h>

#include <Keypad_I2C.h>
#include <Keypad.h>

That compiles fine.
And to save you more trouble. Update the ArduinoIDE to 1.8.12 -your version has some features like missing baud selection in serial monitor, not really working tool chain aso.

Codebreaker007
  • 2,911
  • 1
  • 10
  • 22