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