Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

MODs and examples

日本語

A MOD is a user application that runs on the Stack-chan host firmware.

Try a MOD

Find published MODs in the MOD Gallery. Search by name or capability, then run a MOD in the simulator or on a device. You can change block-based MODs in the block editor.

When choosing a MOD, review the capabilities and supported targets shown on its card. If the MOD uses an external service or network access, inspect the linked source code before installing it. At installation time, the Gallery automatically checks the target chip, XS version, and firmware compatibility.

MOD Gallery

The examples directory contains source code for learning APIs, testing, and local development. Some examples are also published in the Gallery. The Gallery and examples do not yet contain the same set of MODs, but they will be aligned over time.

Create a MOD

Create one in a browser

The block editor lets you assemble behavior with Blockly and build a MOD in the browser. You can test the result in the simulator and install it on a compatible device. Follow the block editor tutorial to create a first project.

Block editor

Create one from source

A MOD can be implemented as a JavaScript or TypeScript module. TypeScript MODs use the public Stack-chan capability types and Moddable module specifiers.

To install a MOD from a local environment, specify its manifest from the firmware directory:

npm run mod -- mods/examples/look_around/manifest.json

See Build and flash programs for setup, target-specific commands, and installation details.

MOD runtime model

Installing a MOD makes the host run that MOD instead of its default behavior. Button and screen behavior therefore depends on the installed MOD.

A MOD must be built for the target device and the XS version used by its host. For the WASM host, load an .xsb or archive built with a target that supports TypeScript, such as lin.

Add localized UI text as described in Firmware localization through context.i18n. To add a Piu UI while retaining the face screen and host AppBar, use the experimental mini-app framework (Japanese).

Representative source examples

Example What it demonstrates
look_around Minimal head movement through the motion API
localized_drawer Localized UI through context.i18n
mini_app_sample A mini app that retains the face screen and AppBar
stackchan_catch A Game & Watch-style mini-app with discrete falling-item states
stackchan_minigames One mini-app archive that packages Stack-chan JUMP and CATCH together
local_peer_hello Typed device-to-device messages without the internet
web_radio Network audio playback on M5StackChan CoreS3
m5stackchan_smoke M5StackChan CoreS3 servo-power and head LED checks

References