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

    Detecting USB power supply

    M5 Stick/StickC
    2
    3
    4.3k
    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
      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
        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
          soulid
          last edited by

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

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