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 :).