Hi,
I’m attempting to use the SPX-17870 with an Adafruit Feather nRF52840 Express using Circuit Python for a Bluetooth Macro Keypad.
My issue is that the SPX-17870 powers back on after about 8 seconds of being off.
I initially configure FastOff as an Input to pull it up, otherwise the Soft Switch doesn’t turn on.
In Circuit Python setup I have:
Sparkfun Soft switch
FastOff = DigitalInOut(board.D2)
FastOff.direction = Direction.INPUT
FastOff.pull = digitalio.Pull.UP
PowerButton = DigitalInOut(board.D5)
PowerButton.direction = Direction.INPUT
PowerButton.pull = digitalio.Pull.UP
Then in the key switch and power switch detection loop, I’ve got the following. Note that I’m “printing” over Bluetooth HID (kl.write) so I can see what’s happening without a USB connection. I apologize for the lack in indentation. Apparently the forum eats excess spaces.
if not PowerButton.value: # check if Power button pressed
kl.write(“Got Power Button down.\n”)
while not PowerButton.value: # if it has, wait until release
pass
kl.write(“Got Power Button up.\n”)
time.sleep(1)
kl.write(“Power Down.\n”)
FastOff.direction = Direction.OUTPUT
FastOff.value = False # then Power Off
Any idea what is going on here?
Note that Bluetooth functionality is working fine, including detecting and powering off the Feather. The Soft Switch just won’t stay off.
Thanks.
Jeff
code.txt (4.19 KB)