Hey guys, newby question.
So, I am wondering if it is bad form or perfectly okay to set a digital output to the same value over and over again if nothing changed. For example, if I had something like this:
void loop() {
if (isThingOn()) {
digitalWrite(ledPin, HIGH);
}
}
So in this case, assuming isThingOn() is true, on every iteration I would be setting the ledPin HIGH. Since it was already high, nothing changes and it just keeps the LED on. Is this proper, or is there any downside that would make it desirable to only change the output if the value is different than the one already in use?
Thanks.