Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atm_led fails to turn off if using the level map feature #82

Open
whittedb opened this issue Dec 17, 2020 · 0 comments
Open

Atm_led fails to turn off if using the level map feature #82

whittedb opened this issue Dec 17, 2020 · 0 comments

Comments

@whittedb
Copy link

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);
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant