add optional pullup code

This commit is contained in:
Dan Halbert 2024-01-12 20:22:29 -05:00
parent f2f1ced82b
commit ce2a50383d

View file

@ -9,7 +9,7 @@ Attach five buttons with pullup resistors to Feather nRF52840
"""
import time
import board
from digitalio import DigitalInOut, Direction
from digitalio import DigitalInOut, Direction, Pull
import adafruit_ble
from adafruit_ble.advertising import Advertisement
@ -32,6 +32,13 @@ button_3.direction = Direction.INPUT
button_4.direction = Direction.INPUT
button_5.direction = Direction.INPUT
# NOTE: If you are not using buttons with built-in pullups, uncomment the five lines below.
# button_1.pull = Pull.UP
# button_2.pull = Pull.UP
# button_3.pull = Pull.UP
# button_4.pull = Pull.UP
# button_5.pull = Pull.UP
hid = HIDService()
device_info = DeviceInfoService(software_revision=adafruit_ble.__version__,