Skip to content

M5StickC and M5StickCplus migrate drives from pins/i2c to Ecma-419#1609

Closed
stc1988 wants to merge 3 commits into
Moddable-OpenSource:publicfrom
stc1988:migrate/sensors_m5stickc
Closed

M5StickC and M5StickCplus migrate drives from pins/i2c to Ecma-419#1609
stc1988 wants to merge 3 commits into
Moddable-OpenSource:publicfrom
stc1988:migrate/sensors_m5stickc

Conversation

@stc1988
Copy link
Copy Markdown
Contributor

@stc1988 stc1988 commented May 10, 2026

Migrate below drivers from pins/i2c to Ecma-419 sensor and peripheral.

  • AXP192
  • BM8563
  • MPU6886
  • SH200Q(M5StickC only)

And I updated the M5StickC-related examples to use these drivers.

@stc1988 stc1988 marked this pull request as ready for review May 10, 2026 09:20
@stc1988
Copy link
Copy Markdown
Contributor Author

stc1988 commented May 19, 2026

There’s an additional update.

I enabled the PEK (Power Enable Key) on the AXP192 so that short presses of the power button can be detected. However, since pekstate needs to be polled, it’s disabled by default.

@phoddie
Copy link
Copy Markdown
Collaborator

phoddie commented May 20, 2026

The changes look good. The power button implementation is a reasonable solution given that polling is necessary.

For future reference, you can now write these...

const white = render.makeColor(255, 255, 255);
const blue = render.makeColor(0, 0, 255);

as

const white = render.makeColor("white");
const blue = render.makeColor("blue");

Since they are cached at start-up, there's no meaningful performance difference. The readability is nice. Also, the list of colors can be extended by the host. That means that a Stack-chan host could provide color names that are used in the Stack-chan UI. I suggest sticking to color names (e.g. "bright orange" and not drift into uses ("mouth", "background", etc).

@mkellner
Copy link
Copy Markdown
Collaborator

This has been merged and will be available in the next code drop.

@mkellner mkellner closed this May 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants