Skip to content

Commit

Permalink
Fix digitalWrite not activating pull-up on ESP8266 Arduino Core 2.6.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
cstanke committed Dec 1, 2019
1 parent 63daf02 commit 802f371
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ClickButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,14 @@ ClickButton::ClickButton(uint8_t buttonPin, boolean activeType, boolean internal
multiclickTime = 250; // Time limit for multi clicks
longClickTime = 1000; // time until "long" click register
changed = false;
pinMode(_pin, INPUT);
//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) digitalWrite(_pin,HIGH);
if (_activeHigh == LOW && internalPullup == CLICKBTN_PULLUP)
pinMode(_pin, INPUT_PULLUP);
else
pinMode(_pin, INPUT);

}


Expand Down

0 comments on commit 802f371

Please sign in to comment.