After attempting to implement an led using the level map and brightness features and the led failing to turn off, I looked at the code.
The logic in the action() ENT_OFF code path seems wrong to me unless I'm having a senior moment and missing something obvious. I believe the correct logic should be as follows.
if (activeLow) {
digitalWrite(pin, HIGH);
} else {
if (levelMapSize) {
analogWrite(pin, 0);
} else {
digitalWrite(pin, LOW);
}
}
After attempting to implement an led using the level map and brightness features and the led failing to turn off, I looked at the code.
The logic in the action() ENT_OFF code path seems wrong to me unless I'm having a senior moment and missing something obvious. I believe the correct logic should be as follows.