if (digitalRead(ButtonPin) == LOW) { //} OR if (digitalRead(ButtonPin) == HIGH) { // return HIGH; } else { //}
I came across these two methods of testing a button. They both accomplish the same thing.
Why would a coder use one over the other? What are advantages/disadvantages to using either?
I am a code resurrectionist not a programmer or coder. I usually cut and paste code parts to develop a working project. I have code that use both methods. I'm curious what falls into best practice? Does one provide better performance?