Closed sabag closed 3 years ago
look at this https://github.com/marcobrianza/ClickButton/blob/master/ClickButton.cpp#L111 it already enables pullup in the correct case. I found it to work on ESP8266
ok so its probably something else because i tested it on wemos d1 mini and it did not work.
some pins have external resistor connected to pins, for example try to use D1, D2, D5,D6,D7
I can confirm that on ESP8266 based hardware with esp8266 Arduino Core 2.6.1, the code, as currently written, does not activate the internal pull-up on pull-up enabled pins.
The following code change works:
//pinMode(_pin, INPUT);
// Turn on internal pullup resistor if applicable
//if (_activeHigh == LOW && internalPullup == CLICKBTN_PULLUP) digitalWrite(_pin,HIGH);
if (_activeHigh == LOW && internalPullup == CLICKBTN_PULLUP)
pinMode(_pin, INPUT_PULLUP);
else
pinMode(_pin, INPUT);
I've submitted a pull request with supporting documentation on this.
hello, I just merged the pull requests about this issue
this library is awesome but it is not working on ESP8266. I was able to very easily fix it to work on ESP8266 by changing the code to :
pinMode(_pin, INPUT_PULLUP);
instead of INPUT.
does this makes sense ? could this be pushed into the master ?