Closed lenaschimmel closed 2 years ago
Yes, that's right, we should get rid of BUTTON_PULLDOWN
here.
You're welcome to create a PR for this.
Generally, the SimpleButton Arduino lib should be changed by a more popular, better maintained lib. Any suggestions would be welcome.
The way the button hardware is defined seems ambiguous to me. In
main.c
there is a check forBUTTON_PULLUP
, whilebutton.c
checks forBUTTON_PULLDOWN
:So it seems to me that one should always define
BUTTON_PULLUP
orBUTTON_PULLDOWN
. When defining both, or defining none, the output on startup and the actual behavior do not match, but there's no error or warning. Five of thehal/*.h
headers defineBUTTON_PULLUP
, none of the files defineBUTTON_PULLDOWN
.I noticed that the button functionality uses the Arduino lib SimpleButton by @spacehuhn, which has:
Button
, which needs an external pull up or pull down resistorButtonPullup
, which enables the integrated pull up resistorSo it would be consistent to use only the definition
BUTTON_PULLUP
and get rid ofBUTTON_PULLDOWN
.(I can also make a PR for this, but since I'm completely new to Arduino and ESP32 development, first I'd like to hear if I'm on the right track.)