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

    Detecting USB power supply

    Scheduled Pinned Locked Moved M5 Stick/StickC
    3 Posts 2 Posters 5.2k Views 1 Watching
    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
      soulid
      last edited by

      Hi,
      I am searching for guidance to trigger an WIFI action when the USB power supply has been detected.
      In my case the M5StickC is connected to my amplifier by USB Plug and as soon as the amplifier is switched on, the M5Stick shall send a wifi command enabling 2 WIFI plugs activating the rest of the stuff.

      I have some experience with Arduino, but not specifically with M5StickC. Please guide me...

      Stay safe and healthy!

      1 Reply Last reply Reply Quote 0
      • R Offline
        robalstona
        last edited by

        see this file

        https://github.com/m5stack/M5StickC/blob/master/src/AXP192.h

        It is a part of M5StickC library for arduino

        You find it in a functions that help you to determine when power is connected to usb port, what voltage input and what current flow.

        You should interest this functions of axp192
        GetVinVoltage();
        GetVinCurrent();

        1 Reply Last reply Reply Quote 0
        • S Offline
          soulid
          last edited by

          Thanks for the hint. I got the script working now!

          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