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

Library does not support buttons with pull down resistors #7

Open
divinofire opened this issue Sep 8, 2021 · 8 comments
Open

Library does not support buttons with pull down resistors #7

divinofire opened this issue Sep 8, 2021 · 8 comments

Comments

@divinofire
Copy link

divinofire commented Sep 8, 2021

I have a working project, it's stressful and error-prone for me to open it and change the button connection with a pull-down resistor to a pull-up resistor. I would like to just program the buttons to support debounce through the programming interface without modifying the hardware.

@divinofire divinofire changed the title Library does not support buttons wil pull down resistors Library does not support buttons with pull down resistors Sep 8, 2021
@ArduinoGetStarted
Copy link
Owner

Dear Divino-Fire,
The library has not supported pull-down resistor yet. We planed to add it in the next release. But we have not had a specific release date yet.

@homonto
Copy link

homonto commented Nov 9, 2022

I am 100% for inverted buttons as well to be added. Btw I am an electrician with hundred years of experience, and since I was in school, the ON was always when something is HIGH, so I always design my projects to be LOW = OFF, HIGH = ON.
Anyway, free software so nothing to complain about ;-)

@ArduinoGetStarted
Copy link
Owner

Dear @homonto
Me too, I like to design like that. But parts of the world does not like that. I think that is why the concepts "Low trigger", "High trigger", "Normally Open", "Normally Closed" appears

@jimtran93
Copy link

HI @ArduinoGetStarted! Just wondering if the library has been updated to support pull-down resistors. I am trying to use this on the Adafruit ESP32-S2 Reverse TFT that has two buttons that are normally low, and one button that is normally high.

@hselomein
Copy link

Hi I am also wondering if there is pulldown support yet. I hac a project that uses 3 buttons in a pulldown configuration. in 3 GPIOs that do not have internal pull up or down resistors

@ArduinoGetStarted
Copy link
Owner

ArduinoGetStarted commented Nov 28, 2023 via email

@homonto
Copy link

homonto commented Nov 28, 2023

Hi I am also wondering if there is pulldown support yet. I hac a project that uses 3 buttons in a pulldown configuration. in 3 GPIOs that do not have internal pull up or down resistors

hi @hselomein
use this one: spacehuhn/SimpleButton - it has full config including pullup and down

@drf5n
Copy link

drf5n commented Aug 8, 2024

If you use pulldown resistors, you can make use of these bits:

ezButton(int pin, int mode);

button/src/ezButton.cpp

Lines 34 to 43 in 2b2d120

ezButton::ezButton(int pin): ezButton(pin, INPUT_PULLUP) {};
ezButton::ezButton(int pin, int mode) {
btnPin = pin;
debounceTime = 0;
count = 0;
countMode = COUNT_FALLING;
pinMode(btnPin, mode);

and write:

ezButton button(7,INPUT); // rely on external pulldown resistor

or if you are on a device with INPUT_PULLDOWN you can:

ezButton button(7,INPUT_PULLDOWN); // use internal pulldown resistor

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

6 participants