Arduino Forum
Why not use: x = !x;?
Other Hardware
LEDs and Multiplexing
SteveMann
November 3, 2021, 9:56pm
2
No. Both codes will compile to the same binary
1 Like
show post in topic
Related topics
Topic
Replies
Views
Activity
Not understanding toggle code
Programming
33
10854
May 5, 2021
Conditional in digitalWrite()?
Programming
35
8836
May 5, 2021
Using digitalWrite(x, !digitalRead(x)) to toggle a pin in OUTPUT mode
Programming
135
5230
September 21, 2023
Are digital pin states acting as boolean values indended or a misfeature?
Programming
10
4616
May 5, 2021
Correct use of digital read and bool
General Discussion
168
2957
April 17, 2024