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

    How to switch the Atom Socket(HLW8023) on/off?

    Atom
    2
    4
    3.2k
    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.
    • T
      tgprivate
      last edited by

      I can't get any description about the HLW8032 Socket's controll ways. Could anybody who has the python code to do this give me some tips? Thanks a lot.

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

        Hello @tgprivate

        from the schematic the relay is switched on/off through GPIO23.

        Using UiFlow Pin blocks and looking at the Python code I get this:

        from m5stack import *
        from m5ui import *
        from uiflow import *
        import machine
        
        pin0 = machine.Pin(23, mode=machine.Pin.OUT, pull=machine.Pin.PULL_UP)
        pin0.on()
        pin0.off()
        

        Note: untested

        Thanks
        Felix

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

        T 1 Reply Last reply Reply Quote 1
        • T
          tgprivate @felmue
          last edited by

          @felmue It works according to your method, thank you very much!

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

            Hello @tgprivate

            glad to hear it worked. And thank you for reporting back.

            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