Skip to content

Commit 192d9c3

Browse files
Fixing bug for platform that is not support internal pull-downs
1 parent 7f5fcca commit 192d9c3

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=ezButton
2-
version=1.0.5
2+
version=1.0.6
33
author=ArduinoGetStarted.com
44
maintainer=ArduinoGetStarted.com (ArduinoGetStarted@gmail.com)
55
sentence=Button library for Arduino, ESP32, ESP8266...

src/ezButton.h

+7-2
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,14 @@
4040

4141
// Constants for button modes
4242
#define INTERNAL_PULLUP INPUT_PULLUP
43+
#ifdef INPUT_PULLDOWN
4344
#define INTERNAL_PULLDOWN INPUT_PULLDOWN
44-
#define EXTERNAL_PULLUP 2
45-
#define EXTERNAL_PULLDOWN 3
45+
#else
46+
#define INTERNAL_PULLDOWN INPUT
47+
#endif
48+
49+
#define EXTERNAL_PULLUP 0xFE
50+
#define EXTERNAL_PULLDOWN 0xFF
4651

4752
class ezButton
4853
{

0 commit comments

Comments
 (0)