AJB2K3
Published © CC BY-NC-SA

Get Started with the M5Stack ACSSR

Controlling the ACSSR unit from M5Stack using the I2C mode and Direct mode.

BeginnerProtip2 hours558
Get Started with the M5Stack ACSSR

Things used in this project

Hardware components

M5Stack ACSSR
×1
M5Stack Core2 AWS
×1

Software apps and online services

M5Stack UIFlow

Story

Read more

Code

ACSSR Coil activation and deactivation Example.

MicroPython
Connect ACSSR to Core2 and run the demo code to communicate over I2C.
from m5stack import *
from m5stack_ui import *
from uiflow import *
import i2c_bus
import time

screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)

label0 = M5Label('label0', x=20, y=74, color=0x000, font=FONT_MONT_14, parent=None)

i2c0 = i2c_bus.easyI2C(i2c_bus.PORTA, 0x00, freq=400000)
label0.set_text(str(str((i2c0.scan()))))
wait(1)
i2c0.addr=(0x50)
while True:
  i2c0.write_u8(0x00, 0x01)
  wait(1)
  i2c0.write_u8(0x00, 0x00)
  wait(1)
  wait_ms(2)

ACSSR RGB LED colour change.

MicroPython
Connect ACSSR to Core2 and run the demo code to communicate over I2C.
from m5stack import *
from m5stack_ui import *
from uiflow import *
import i2c_bus
import time

screen = M5Screen()
screen.clean_screen()
screen.set_screen_bg_color(0xFFFFFF)

label0 = M5Label('label0', x=20, y=74, color=0x000, font=FONT_MONT_14, parent=None)

i2c0 = i2c_bus.easyI2C(i2c_bus.PORTA, 0x00, freq=400000)
label0.set_text(str(str((i2c0.scan()))))
wait(1)
i2c0.addr=(0x50)
while True:
  i2c0.write_u8(0x10, 0x00)
  i2c0.write_u8(0x11, 0xFF)
  i2c0.write_u8(0x12, 0x00)
  wait(1)
  i2c0.write_u8(0x10, 0x00)
  i2c0.write_u8(0x11, 0x00)
  i2c0.write_u8(0x12, 0xFF)
  wait(1)
  i2c0.write_u8(0x10, 0xFF)
  i2c0.write_u8(0x11, 0x00)
  i2c0.write_u8(0x12, 0x00)
  wait(1)
  wait_ms(2)

Credits

AJB2K3
54 projects • 35 followers
I have always had an interest in electronics but having failed my school exams, it has taken me 20+ years to produce products to share.
Contact

Comments

Please log in or sign up to comment.