Skip to content

Commit 8315480

Browse files
authored
Merge pull request #2707 from dhalbert/ble-keyboard-pulls
add optional pullup code for BLE HID project
2 parents f2f1ced + 0dfa099 commit 8315480

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

CPB_Keybutton_BLE/code.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import time
1111
import board
1212
from digitalio import DigitalInOut, Direction
13+
# Uncomment if setting .pull below.
14+
# from digitalio import Pull
1315

1416
import adafruit_ble
1517
from adafruit_ble.advertising import Advertisement
@@ -32,6 +34,14 @@
3234
button_4.direction = Direction.INPUT
3335
button_5.direction = Direction.INPUT
3436

37+
# NOTE: If you are not using buttons with built-in pullups, uncomment the five lines below,
38+
# and the `from digitalio import Pull` above.
39+
# button_1.pull = Pull.UP
40+
# button_2.pull = Pull.UP
41+
# button_3.pull = Pull.UP
42+
# button_4.pull = Pull.UP
43+
# button_5.pull = Pull.UP
44+
3545
hid = HIDService()
3646

3747
device_info = DeviceInfoService(software_revision=adafruit_ble.__version__,

0 commit comments

Comments
 (0)