🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    M5StickC Plus - detect power button momentary press?

    M5 Stick/StickC
    2
    2
    3.7k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • B
      bazman
      last edited by

      I can't find a way to detect a momentary press of the power button on the M5StickCPlus, only button A and button B detection is described. Is there any way to do this in C++?

      1 Reply Last reply Reply Quote 0
      • felmueF
        felmue
        last edited by

        Hello @bazman

        according to the schematic the power button only is connected to the AXP192 and not to an ESP32 GPIO as are buttons A and B. Luckily the AXP192 can be setup to detect the power button short / long press via interrupt.

        Checkout the AXP192 datasheet - you can find it here. The AXP192 registers dealing with short / long power button press interrupts are 0x42 (IRQ enable 3) and 0x46 (IRQ status 3).

        Thanks
        Felix

        GPIO translation table M5Stack / M5Core2
        Information about various M5Stack products.
        Code examples

        1 Reply Last reply Reply Quote 0
        • First post
          Last post