Need help for uploading

Hi i am new to this, I am having a problem with my code or something, but when I upload my code in the Arduino Uno, it shows this error messsage:
Arduino: 1.8.18 (Windows 10), Board: "Arduino Uno"

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

C:\Users\siya2\Desktop\siya_Drive\Personal\learning outside school\Arduino\wall_follower\wall_follower.ino: In function 'void loop()':

C:\Users\siya2\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:40:14: error: lvalue required as left operand of assignment

#define HIGH 0x1

          ^

C:\Users\siya2\Desktop\siya_Drive\Personal\learning outside school\Arduino\wall_follower\wall_follower.ino:41:38: note: in expansion of macro 'HIGH'

if (rs = HIGH && ls = HIGH && cs = HIGH){

                                  ^~~~

C:\Users\siya2\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:41:14: error: lvalue required as left operand of assignment

#define LOW 0x0

          ^

C:\Users\siya2\Desktop\siya_Drive\Personal\learning outside school\Arduino\wall_follower\wall_follower.ino:44:43: note: in expansion of macro 'LOW'

else if (rs = HIGH && ls = HIGH && cs = LOW){

                                       ^~~

C:\Users\siya2\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:40:14: error: lvalue required as left operand of assignment

#define HIGH 0x1

          ^

C:\Users\siya2\Desktop\siya_Drive\Personal\learning outside school\Arduino\wall_follower\wall_follower.ino:50:42: note: in expansion of macro 'HIGH'

else if (rs = HIGH && ls = LOW && cs = HIGH){

                                      ^~~~

C:\Users\siya2\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:41:14: error: lvalue required as left operand of assignment

#define LOW 0x0

          ^

C:\Users\siya2\Desktop\siya_Drive\Personal\learning outside school\Arduino\wall_follower\wall_follower.ino:58:42: note: in expansion of macro 'LOW'

else if (rs = HIGH && ls = LOW && cs = LOW){

                                      ^~~

C:\Users\siya2\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:40:14: error: lvalue required as left operand of assignment

#define HIGH 0x1

          ^

C:\Users\siya2\Desktop\siya_Drive\Personal\learning outside school\Arduino\wall_follower\wall_follower.ino:62:42: note: in expansion of macro 'HIGH'

else if (rs = LOW && ls = HIGH && cs = HIGH){

                                      ^~~~

C:\Users\siya2\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:41:14: error: lvalue required as left operand of assignment

#define LOW 0x0

          ^

C:\Users\siya2\Desktop\siya_Drive\Personal\learning outside school\Arduino\wall_follower\wall_follower.ino:70:42: note: in expansion of macro 'LOW'

else if (rs = LOW && ls = HIGH && cs = LOW){

                                      ^~~

C:\Users\siya2\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:40:14: error: lvalue required as left operand of assignment

#define HIGH 0x1

          ^

C:\Users\siya2\Desktop\siya_Drive\Personal\learning outside school\Arduino\wall_follower\wall_follower.ino:74:41: note: in expansion of macro 'HIGH'

else if (rs = LOW && ls = LOW && cs = HIGH){

                                     ^~~~

exit status 1

Error compiling for board Arduino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

I know it is a problem in the code, because i tested it on two different arduino boards, and both work. I even selected correct board type and port.

Welcome to the forum

As your topic does not relate directly to the installation or operation of the IDE it has been moved to the Programming category of the forum

As to the error, you have

if (rs = HIGH && ls = HIGH && cs = HIGH){

Use = to assign a value to a variable
Use == to compare two values

1 Like

You apparently did not read How to get the best out of this forum. If you did, you would have known to include the sketch that was causing the problem so we could see what you had done incorrectly.

I would imagine that you have tried to redefine HIGH and LOW somewhere in the sketch that you didn't show.

1 Like

Take 2x 3 minutes of yout time to learn how to post code or error-messages as a code-section

thanks. i forgot that in equals to under an if condition, we have to add two equals to symbols

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.