spacehuhn / SimpleButton

A simple Arduino library to make interfacing and reacting on buttons or other inputs easier.
MIT License
67 stars 21 forks source link

missing INPUT_PULLDOWN #7

Open homonto opened 1 year ago

homonto commented 1 year ago

hi, in case of button to be active HIGH, there should be proper way of pulling down the pin there is nothing I could find like this in your code so I had to add it manually maybe it would be good to have such functionality (when inverted make it pull down)?

or maybe I am not doing it properly?

papio@MBP16papio SimpleButton % grep -R PULL * examples/PullupButton/PullupButton.ino: // ButtonPullup will do "pinMode(12, INPUT_PULLUP)" isntead of "pinMode(12, INPUT)". src/Buttons/PS2Gamepad.cpp: pinMode(dataPin, INPUT_PULLUP); src/Buttons/ButtonPullup.cpp: pinMode(button_pin, INPUT_PULLUP); src/libs/MCP23017.cpp: setPinMode(pin, pullup ? INPUT_PULLUP : INPUT); src/libs/MCP23017.cpp: bool input = (mode == INPUT || mode == INPUT_PULLUP); src/libs/MCP23017.cpp: bool pullup = (mode == INPUT_PULLUP); src/libs/MCP23017.cpp: if (pullup) return INPUT_PULLUP; papio@MBP16papio SimpleButton %