question about " if (a=0&&b&&c)"

Hi Everyone,

I’m new to the Arduino. I have a question about if (a=0&&b&&c).

What does this mean?

I’m programming a line tracking car with 3 infrared sensor to detect the line.

Thank you very much!

Best!

if a = 0 and b = true and c = true

a=0 should be a==0

yes, it is a==0.

Thank you very much!

puyuneu: Hi Everyone,

I'm new to the Arduino. I have a question about if (a=0&&b&&c).

What does this mean?

I'm programming a line tracking car with 3 infrared sensor to detect the line.

Thank you very much!

Best!

This is terrible style. Single character variables are useless. You should make any possible effort to make it human readable, for example:

if (a==0 and b and c)

See how much easier that is to read? The compiler sees no difference.

Aarg, Thank you for your advise!
I will try my best to make it better. There are a lot of things to learn.

puyuneu: Aarg, Thank you for your advise! I will try my best to make it better. There are a lot of things to learn.

Avoid cheesy glam tutorials and videos and try to learn directly from documentation.

So it's like this.... if (a==0 && b==1 && c==1) right?

if(a == 0 && b != 0 && c != 0)

I think. :)