ACSSR I2c control
-
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 -
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.
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 -
@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.
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
FelixThanks mate, I didn't know you had to set the slave address, that explains why noting is working.
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