0

Any way to use all four buttons on MagTag for PinAlarms?
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Any way to use all four buttons on MagTag for PinAlarms?

by nealdt on Tue Jan 12, 2021 2:23 pm

Hi everyone,

I was able to get the new PinAlarm code working on my MagTag to wake on button press from deep sleep:

Code: Select all | TOGGLE FULL SIZE
magtag.peripherals.buttons[0].deinit()
magtag.peripherals.buttons[1].deinit()

alarm.exit_and_deep_sleep_until_alarms(
    PinAlarm(pin=board.BUTTON_A, value=False, pull=True),
    PinAlarm(pin=board.BUTTON_B, value=False, pull=True)
)


However, I can't use all four buttons -- there is an exception that only 2 LOW pins can wake from deep sleep. Is there any workaround for this, so that I can use all four buttons to wake up? The buttons push their pins to LOW when pressed, and I'm too new at this to know if there's another way :).

nealdt
 
Posts: 18
Joined: Mon Feb 10, 2020 5:31 pm

Re: Any way to use all four buttons on MagTag for PinAlarms?

by kattni on Tue Jan 12, 2021 3:24 pm

Unfortunately, there is no work-around. It is a hardware limitation with this revision of the board. That's why the exception exists in the code. It's something that may change with future products, but for now, there is no way to use all four buttons as such.

kattni
 
Posts: 87
Joined: Fri Aug 18, 2017 6:33 pm

Re: Any way to use all four buttons on MagTag for PinAlarms?

by nealdt on Tue Jan 12, 2021 4:51 pm

I understand, thank you!

nealdt
 
Posts: 18
Joined: Mon Feb 10, 2020 5:31 pm

Please be positive and constructive with your questions and comments.