Page 1 of 1

ESP32 COMPILING ERROR whit PS3 Controller.h

Posted: Sat Jan 16, 2021 5:48 pm
by moi21_5
It shows me this warning, i dont knows what thats mena, but i tried everything, like update Arduino IDE, update Espressif data, board preferences, and it doesnt compile.
Im new here, can you help me? Thanks.


[Codebox]

Code: Select all

C:\Users\Moisés\Desktop\arduinos\sketch_jan16c\sketch_jan16c.ino: In function 'void setup()':
C:\Users\Moisés\Desktop\arduinos\sketch_jan16c\sketch_jan16c.ino:205:34: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
C:\Users\-----\Documents\Arduino\libraries\PS3_Controller_Host\src\ps3.c: In function 'ps3SetLed':
C:\Users\------\Documents\Arduino\libraries\PS3_Controller_Host\src\ps3.c:160:5: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
     if(cmd.led4 = player >= 4) player -= 4;
     ^
C:\Users\-----\Documents\Arduino\libraries\PS3_Controller_Host\src\ps3.c:161:5: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
     if(cmd.led3 = player >= 3) player -= 3;
     ^
C:\Users\-----\Documents\Arduino\libraries\PS3_Controller_Host\src\ps3.c:162:5: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
     if(cmd.led2 = player >= 2) player -= 2;
     ^
C:\Users\-----\Documents\Arduino\libraries\PS3_Controller_Host\src\ps3.c:163:5: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
     if(cmd.led1 = player >= 1) player -= 1;
     ^
cc1.exe: some warnings being treated as errors
exit status 1
Error compilando para la tarjeta ESP32 Dev Module.
[/Codebox]

Re: ESP32 COMPILING ERROR whit PS3 Controller.h

Posted: Sun Jan 17, 2021 7:16 pm
by chegewara
moi21_5 wrote:
Sat Jan 16, 2021 5:48 pm
C:\Users\------\Documents\Arduino\libraries\PS3_Controller_Host\src\ps3.c:160:5: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
if(cmd.led4 = player >= 4) player -= 4;
^
C:\Users\-----\Documents\Arduino\libraries\PS3_Controller_Host\src\ps3.c:161:5: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
if(cmd.led3 = player >= 3) player -= 3;
^
C:\Users\-----\Documents\Arduino\libraries\PS3_Controller_Host\src\ps3.c:162:5: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
if(cmd.led2 = player >= 2) player -= 2;
^
C:\Users\-----\Documents\Arduino\libraries\PS3_Controller_Host\src\ps3.c:163:5: error: suggest parentheses around assignment used as truth value [-Werror=parentheses]
if(cmd.led1 = player >= 1) player -= 1;
^
cc1.exe: some warnings being treated as errors
exit status 1
Error compilando para la tarjeta ESP32 Dev Module.[/code][/Codebox]
Did you try to fix those errors? This is very descriptive error:

Code: Select all

error: suggest parentheses around assignment used as truth value
https://www.google.com/search?q=error%3 ... e&ie=UTF-8