🤖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?)

    Scheduled Pinned Locked Moved M5 Stick/StickC
    4 Posts 3 Posters 5.8k Views
    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 Offline
      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 Online
        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 Offline
          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 Offline
            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

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • First post
              Last post