Re: Arduino Language Question - "and"

I have a simple language question - being very tired and typing out "and" instead of what I meant to type "&&" which applies to the code I'm writing, this resulted in the discovery that the word "and" is highlighted in green. Haven't seen that before.

I tried searching to figure out what this "and" does and I can't find anything relevant. I also checked and searched the documentation and couldn't find anything there either. I'm guessing it's bitwise and, I don't have a good idea to test this is so.

What does "and" mean in arduino language? is there a reasonable || accepted use for it?

Thanks! Hopefully this will get picked up in the search engines in case anyone else has the same question

and in C++, as used by the Arduino, is exactly the same as &&, ie logical and

You can also use or in place of || for logical or

1 Like

... also a favourite of mine, 'not' instead of '!'.

Great to know! Thanks for answering!

This may become a new favorite of mine as well : )

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