You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-6Lines changed: 8 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# MicroPython ESP8266/ESP32 Driver for TTP229-BSF 16-key Capacitive Keypad in Serial Interface Mode
2
2
3
-
This MicroPython driver is for TTP229-BSF capacitive keypad on ESP8266/ESP3. Tested on both ESP8266 (WeMos D1 mini) and ESP32 (BPI:bit) with v1.11 firmware.
3
+
This MicroPython driver is for TTP229-BSF capacitive keypad on ESP8266/ESP32. Tested on both ESP8266 (WeMos D1 mini) and ESP32 (BPI:bit) with v1.11 firmware.
4
4
5
5
The serial interface of TTP229-BSF <b>is not I2C</b> but it allows you to control this keypad via only 2 wires. Not to be confused with TTP229-LSF, which is a true I2C device.
6
6
@@ -44,7 +44,9 @@ while True:
44
44
# return a list like (0, 2, 11, 15) in multiple mode
45
45
```
46
46
47
-
<b>input</b> parameter:
47
+
## Parameter
48
+
49
+
You can set the following initializing parameter:
48
50
49
51
***input=8** (default): 8 key mode
50
52
***input=16**: 16 key mode
@@ -54,13 +56,13 @@ while True:
54
56
***multi=False** (default): single mode
55
57
***multi=True**: multiple mode
56
58
57
-
In single mode keypad.read() will return the index of the pressed key (0~15). Return -1 when no key is pressed.
59
+
In single mode ```keypad.read()``` will return the index of the pressed key (0~15). Return -1 when no key is pressed.
58
60
59
-
In multiple mode keypad.read() will return a list containing all the indexes of pressed keys. Return an empty list when no key is pressed.
61
+
In multiple mode ```keypad.read()``` will return a list containing all the indexes of pressed keys. Return an empty list when no key is pressed.
60
62
61
63
If the TTP229-BSF is configured to multiple mode, read it in single mode will return the lowest index of all pressed keys. Read in multiple mode for a keypad configured in single mode, you'll get a list containing only one key index if any key is pressed.
62
64
63
-
There's also a <b>raw</b> parameter, default False. When set as True, keypad.read() will return the raw 8 or 16 key list indicating all keys' status (from key 0 to 15; value 1 = not pressed, 0 = pressed).
65
+
There's also a <b>raw</b> parameter, default ```False```. When set as ```True```, ```keypad.read()``` will return the raw 8 or 16 key list indicating all keys' status (from key 0 to 15; value 1 = not pressed, 0 = pressed).
0 commit comments