SPX-17870, Soft Power Switch powering On after Fast_Off

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)

Does it stay off when you use FastOff in the SoftPowerSwitch_Example?

I don’t know, I haven’t tried it. I’m not using the Arduino IDE (Mu and Circuit Python), so I’d have to figure out how to install the board manager, etc. Something I haven’t done yet.

Read through the code here https://github.com/sparkfunX/Soft_Power … xample.ino and see if there’s an error in your “High”/“Low”, or input/output, etc. that stands out :smiley:

Ok. I’m also working through the Arduino switchover. I got the blinky example to work and Circuit Python uninstalled. Now looking for the Arduino pin map for the Adafruit nRF52840.

Thanks.

Jeff