Hello everyone I am trying to add Rbdimmer in my project but i got an error can someone told me why this happens,
error while compile:
Arduino: 1.8.12 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled (new can abort), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), 2, v2 Lower Memory, Disabled, None, Only Sketch, 115200"
In file included from C:\Users\jamsa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266/Arduino.h:29:0,
from sketch\ESP8266_jul06a.ino.cpp:1:
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:32:11: error: 'OFF' redeclared as different kind of symbol
OFF = false,
^
In file included from C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src/ArduinoIoTCloud.h:33:0,
from sketch\thingProperties.h:3,
from C:\Users\jamsa\OneDrive\Desktop\Arduino cloud My idea\ESP8266_jul06a - Copy\ESP8266_jul06a\ESP8266_jul06a.ino:2:
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src/AIoTC_Const.h:26:19: error: previous declaration of 'const bool OFF'
static bool const OFF = false;
^
In file included from C:\Users\jamsa\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.7.4\cores\esp8266/Arduino.h:29:0,
from sketch\ESP8266_jul06a.ino.cpp:1:
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:33:10: error: 'ON' redeclared as different kind of symbol
ON = true
^
In file included from C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src/ArduinoIoTCloud.h:33:0,
from sketch\thingProperties.h:3,
from C:\Users\jamsa\OneDrive\Desktop\Arduino cloud My idea\ESP8266_jul06a - Copy\ESP8266_jul06a\ESP8266_jul06a.ino:2:
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\ArduinoIoTCloud\src/AIoTC_Const.h:25:19: error: previous declaration of 'const bool ON'
static bool const ON = true;
^
C:\Users\jamsa\OneDrive\Desktop\Arduino cloud My idea\ESP8266_jul06a - Copy\ESP8266_jul06a\ESP8266_jul06a.ino: In function 'void setup()':
ESP8266_jul06a:131:31: error: no matching function for call to 'dimmerLamp::begin(DIMMER_MODE_typedef, const bool&)'
dimmer.begin(NORMAL_MODE, ON);
^
C:\Users\jamsa\OneDrive\Desktop\Arduino cloud My idea\ESP8266_jul06a - Copy\ESP8266_jul06a\ESP8266_jul06a.ino:131:31: note: candidate is:
In file included from C:\Users\jamsa\OneDrive\Desktop\Arduino cloud My idea\ESP8266_jul06a - Copy\ESP8266_jul06a\ESP8266_jul06a.ino:3:0:
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:63:14: note: void dimmerLamp::begin(DIMMER_MODE_typedef, ON_OFF_typedef)
void begin(DIMMER_MODE_typedef DIMMER_MODE, ON_OFF_typedef ON_OFF);
^
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:63:14: note: no known conversion for argument 2 from 'const bool' to 'ON_OFF_typedef'
exit status 1
no matching function for call to 'dimmerLamp::begin(DIMMER_MODE_typedef, const bool&)'
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
The issue is that these conflicting declarations exist in both the libraries you are using so you will have to modify the source of one of the libraries. Probably the easiest would be the RBDimmer library.
Thank you so much for your support,
I am thinking same as you, but dear sir I don't know how to modify Rbdimeer lib header fir and which syntax or sentence I change.
and then change all occurrences of ON and OFF in the rbdimmer.cpp file as well
EDIT: Just looked at the library and there are individual .h/.cpp files for each of the architectures. You will have to change all occurrences in all the files (or at least for the architecture you are using)
Arduino: 1.8.12 (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 D:\Adminstration\Upgreat\Arduino Server fAN\FANcontrol\Untitled_aug02a\Untitled_aug02a.ino:4:0:
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:63:53: error: 'RBDIMMER_ON_RBDIMMER_OFF' has not been declared
void begin(DIMMER_MODE_typedef DIMMER_MODE, RBDIMMER_ON_RBDIMMER_OFF _typedef RBDIMMER_ON_RBDIMMER_OFF );
^
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:63:87: error: expected ',' or '...' before 'RBDIMMER_ON_RBDIMMER_OFF'
void begin(DIMMER_MODE_typedef DIMMER_MODE, RBDIMMER_ON_RBDIMMER_OFF _typedef RBDIMMER_ON_RBDIMMER_OFF );
^
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:66:17: error: 'RBDIMMER_ON_RBDIMMER_OFF' has not been declared
void setState(RBDIMMER_ON_RBDIMMER_OFF _typedef RBDIMMER_ON_RBDIMMER_OFF );
^
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:66:51: error: expected ',' or '...' before 'RBDIMMER_ON_RBDIMMER_OFF'
void setState(RBDIMMER_ON_RBDIMMER_OFF _typedef RBDIMMER_ON_RBDIMMER_OFF );
^
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.
Arduino: 1.8.12 (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 D:\Adminstration\Upgreat\Arduino Server fAN\FANcontrol\Untitled_aug02a\Untitled_aug02a.ino:4:0:
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:63:53: error: 'RBDIMMER_ON_RBDIMMER_OFF' has not been declared
void begin(DIMMER_MODE_typedef DIMMER_MODE, RBDIMMER_ON_RBDIMMER_OFF _typedef RBDIMMER_ON_RBDIMMER_OFF );
^
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:63:87: error: expected ',' or '...' before 'RBDIMMER_ON_RBDIMMER_OFF'
void begin(DIMMER_MODE_typedef DIMMER_MODE, RBDIMMER_ON_RBDIMMER_OFF _typedef RBDIMMER_ON_RBDIMMER_OFF );
^
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:66:17: error: 'RBDIMMER_ON_RBDIMMER_OFF' has not been declared
void setState(RBDIMMER_ON_RBDIMMER_OFF _typedef RBDIMMER_ON_RBDIMMER_OFF );
^
C:\Users\jamsa\OneDrive\Documents\Arduino\libraries\RBDDimmer-master\src/RBDdimmer.h:66:51: error: expected ',' or '...' before 'RBDIMMER_ON_RBDIMMER_OFF'
void setState(RBDIMMER_ON_RBDIMMER_OFF _typedef RBDIMMER_ON_RBDIMMER_OFF );
^
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.