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

    M5stickC turn on when connect Type-C USB with power (How to disable?)

    M5 Stick/StickC
    3
    4
    4.5k
    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.
    • S
      sgnp2091
      last edited by

      When I plugin Type-C USB with power, M5stickC will turn on automatically. Is it possible to disable?

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

        Hello @sgnp2091

        do you mean disable by software or hardware?

        The way M5StickC Plus is wired internally I don't think it is possible to disable this functionality by software, but I guess it would be possible by a hardware modification.

        Thanks
        Felix

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

        S 1 Reply Last reply Reply Quote 0
        • S
          sgnp2091 @felmue
          last edited by

          @felmue

          I would like to disable this function by Arduino. I don't want to modify the hardware. Btw, thank you for your reply.

          1 Reply Last reply Reply Quote 0
          • E
            edoceder
            last edited by

            Don't know if still relevant, but you can just power it off if you see it was plugged in.
            I attach a basic code here, and you can tweak it to your needs of course.

            Be aware that you might need to use a small delay before M5.Axp.GetVBusVoltage() will give you a result you can trust.

            //function which reads the voltage coming out of the USB, and if it's above 4.1 I know the device is being charged.
            bool isBeingCharged()
            {
            float charge = M5.Axp.GetVBusVoltage();
            //Serial.println(charge);
            return charge > 4.1;
            }

            //check here of anywhere you want in the code if the device is being charged, and power it off.
            void setup()
            {
            if (isBeingCharged())
            {
            M5.Axp.PowerOff();
            }
            }

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