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

    ACSSR I2c control

    Units
    2
    3
    2.7k
    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.
    • ajb2k3A
      ajb2k3
      last edited by

      First off, let me say " I Haz Dumb"!
      I'm trying to run the ACSSR over I2C Using UIFLow and I can not for the life of me workout how to trigger the SSR. has anyone worked this out yet

      UIFlow, so easy an adult can learn it!
      If I don't know it, be patient!
      I've ether not learned it or am too drunk to remember it!
      Author of the WIP UIFlow Handbook!
      M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

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

        Hello @ajb2k3

        first of all make sure when the ACSSR powers on the internal RGB LED blinks red (=I2C mode). If not, follow the instructions here to change mode. (Section Usage/Communication protocol)

        Then use something like below to first scan the I2C bus, set the proper slave address, read the version and then toggle the ACSSR every second.
        Note: I used an M5Atom for this example.

        0_1658576211471_M5AtomUnitACSSRTest_20220723.png

        or from the Micropython tab:

        from m5stack import *
        from m5ui import *
        from uiflow import *
        import i2c_bus
        import time
        
        myToggle = None
        
        i2c0 = i2c_bus.easyI2C(i2c_bus.PORTA, 0x00, freq=400000)
        print(i2c0.scan())
        wait(1)
        i2c0.addr=(0x50)
        print(i2c0.read_u8(0xFE))
        myToggle = False
        while True:
          if myToggle == False:
            myToggle = True
            i2c0.write_u8(0x00, 0x01)
          else:
            myToggle = False
            i2c0.write_u8(0x00, 0x00)
          wait(1)
          wait_ms(2)
        

        Thanks
        Felix

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

        ajb2k3A 1 Reply Last reply Reply Quote 0
        • ajb2k3A
          ajb2k3 @felmue
          last edited by

          @felmue said in ACSSR I2c control:

          Hello @ajb2k3

          first of all make sure when the ACSSR powers on the internal RGB LED blinks red (=I2C mode). If not, follow the instructions here to change mode. (Section Usage/Communication protocol)

          Then use something like below to first scan the I2C bus, set the proper slave address, read the version and then toggle the ACSSR every second.
          Note: I used an M5Atom for this example.

          0_1658576211471_M5AtomUnitACSSRTest_20220723.png

          or from the Micropython tab:

          from m5stack import *
          from m5ui import *
          from uiflow import *
          import i2c_bus
          import time
          
          myToggle = None
          
          i2c0 = i2c_bus.easyI2C(i2c_bus.PORTA, 0x00, freq=400000)
          print(i2c0.scan())
          wait(1)
          i2c0.addr=(0x50)
          print(i2c0.read_u8(0xFE))
          myToggle = False
          while True:
            if myToggle == False:
              myToggle = True
              i2c0.write_u8(0x00, 0x01)
            else:
              myToggle = False
              i2c0.write_u8(0x00, 0x00)
            wait(1)
            wait_ms(2)
          

          Thanks
          Felix

          Thanks mate, I didn't know you had to set the slave address, that explains why noting is working.

          UIFlow, so easy an adult can learn it!
          If I don't know it, be patient!
          I've ether not learned it or am too drunk to remember it!
          Author of the WIP UIFlow Handbook!
          M5Black, Go, Stick, Core2, and so much more it cant be fit in here!

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