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

Use int pin_mode instead of bool pullupActive in OneButton() constructor. #138

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on Mar 7, 2024

  1. Use int pin_mode instead of bool pullupActive.

    explicit OneButton(const int pin, const boolean activeLow = true, const int pin_mode = INPUT_PULLUP);
    
    [[deprecated("Use OneButton(int pin, boolean activeLow, int pin_mode) instead.")]]
    OneButton(const int pin, const boolean activeLow, const bool pullupActive); // deprecated
    
    For example:
    #if defined(BUTTONS_PULLUP)
    userButton = new OneButton(aPIN);
    // it is equivalent to
    userButton = new OneButton(aPIN, true, INPUT_PULLUP);
    #elif defined(BUTTONS_PULLDOWN)
    userButton = new OneButton(aPIN, false, INPUT_PULLDOWN);
    #elif defined(BUTTONS_HIGH_IMPEDANCE)
    userButton = new OneButton(aPIN, true, INPUT);
    #endif
    IhorNehrutsa committed Mar 7, 2024
    Configuration menu
    Copy the full SHA
    1e6b267 View commit details
    Browse the repository at this point in the history