Go back

M5Stack in Velxio: the Cardputer ADV and Core run M5Stack's own examples in the browser

M5Stack builds hardware you can hold in one hand and use out of the box: a screen, buttons, a speaker and a battery are already there when you open the package. That is exactly the kind of board a simulator has to get right in every detail or it is useless, because there is no breadboard to blame. This post is about how M5Stack hardware landed in Velxio, what runs today, and the small test we set ourselves along the way: could M5Stack’s own example sketches run in the browser without changing a line?

They can. Let us start there.

M5Stack’s own display test, unmodified

M5Stack ships a display example with the Cardputer library: random coloured rectangles and text scattered across the screen, forever, as a quick way to see the LCD path running at full speed. We put it in the gallery as it is.

The M5 Cardputer ADV in Velxio running M5Stack's own display example, coloured rectangles and text scattered over the 240x135 screen

To see it yourself:

  1. Open velxio.dev/example/cardputer-adv-m5-display. No sign-up is needed.
  2. On the toolbar at the top, click the play button. The sketch is compiled against the same arduino-esp32 core and M5Cardputer library you would use in the Arduino IDE. A cold build takes a few minutes; a warm one is much faster.
  3. When the board boots, the screen fills with rectangles at the panel’s full 240x135 resolution.
  4. Click on the keyboard, or click the board and use your own keyboard, and open one of the keyboard examples listed at the end of the post to see keystrokes arrive in the sketch.

That sketch is one of fifteen official M5Stack examples in the gallery. On the Cardputer ADV they are the text terminal, button, buzzer, display, IR NEC send, single key, multi key, text input, microSD and REPL guessing game examples. On the Core they are HelloWorld, Button, Display, Speaker and TFCard. Where an example used the classic M5Stack library, which no longer compiles on the arduino-esp32 3.x core (in the Arduino IDE or anywhere else), it was ported to M5Unified, the library M5Stack recommends today. Everything else is untouched.

The two boards

The M5 Cardputer ADV as drawn in Velxio, with its ST7789 screen, 56-key keyboard, top-edge buttons and the STAMP S3A module

M5 Cardputer ADV. The card-sized computer: an ESP32-S3, a 1.14 inch 240x135 screen, a 56-key keyboard, an IMU, a microphone and speaker through an ES8311 codec, an IR emitter, a microSD slot and a battery. In Velxio the screen draws on the board, the whole keyboard types (click the keys, or focus the board and type on your own keyboard), the speaker plays through your computer, and the microphone streams your computer’s mic when you switch on the Mic toggle in the canvas header. The Sensors button next to it tilts the BMI270 IMU and sets the battery level, so code that reacts to either can be exercised. The IR emitter answers as well: a dot on the board flashes with each decoded transmission. The microSD is a real FAT card with an upload panel. Wi-Fi and MicroPython work; the BLE radio is not emulated.

The M5Stack Core as drawn in Velxio, with the 320x240 screen, buttons A, B and C, and the colour-coded M-Bus pin cards on all four edges

M5Stack Core (Basic v2.7). The classic 54x54 mm stackable ESP32 with a 2 inch 320x240 screen behind glass, three front buttons, a speaker, a TF slot and a Grove port. The screen paints, the three buttons click (active-low, as wired), speaker tones play at the sketch’s real pitch, and the TF slot is a real card. The M-Bus pin card is printed on all four edges of the board, colour-coded like the real case, and every pin on it is wireable, so the Core is as good a host for external parts as any DevKit.

Both boards take Arduino C++ and MicroPython, and both come with hover datasheets in the component picker that list the pinout and link to M5Stack’s shop.

The Chain matrices

The M5Stack Chain RGB Matrix and Chain Mono Matrix in Velxio, two 8x8 LED panels with HY2.0 chain ports on the sides

Two M5Stack Chain modules are in the catalog too: the Chain RGB Matrix (64 WS2812E LEDs) and the Chain Mono Matrix (64 white LEDs). In Velxio they are driven as plain WS2812 matrices on their DIN pin, which is how the five gallery examples use them from an Arduino Uno: a rainbow, a white sweep, counting digits, a bouncing ball and a fire effect. The real UART-based Chain protocol is not emulated at this stage; that is on the list.

Working with M5Stack

M5Stack supported this work and provided the hardware. That mattered more than usual here, because so much of what makes these boards useful is on the board itself. The Cardputer ADV in Velxio was brought up against a physical unit: the panel ID that M5GFX reads to detect the display, the GPIO signature that tells the ADV revision from the original, the keyboard scan, the codec on I2C. When the simulated board answers those questions the way the real one does, M5Stack’s libraries do the rest, and that is why their examples run without edits.

We are grateful to the M5Stack team for backing a project that lets people try their hardware in a browser tab before they buy it, and for the open-source libraries (M5Unified, M5GFX, M5Cardputer) that made the integration a matter of getting the hardware right rather than rewriting software.

If you want the physical boards, they are on shop.m5stack.com: the Cardputer ADV, the Basic Core v2.7, the Chain RGB Matrix and the Chain Mono Matrix. The M5Stack documentation lives at docs.m5stack.com.

Everything M5Stack in Velxio runs on the free plan. Open the component picker, pick Boards, and the Cardputer ADV and Core are there next to the other ESP32 boards.

Each link opens the project ready to run.

M5 Cardputer ADV

M5Stack Core

Chain matrices (on an Arduino Uno)

The board pages in the documentation carry the full pinouts: M5 Cardputer ADV and M5Stack Core. The previous post in this series covered Seeed Studio.


Share this post on:
David Montero

Written by

David Montero

Creator of Velxio, the open-source circuit and Arduino simulator.

GitHub velxio.dev

Related posts


Previous Post
Pimoroni supports Velxio: the Badger 2350 e-paper badge, in a browser tab
Next Post
Seeed Studio hardware comes to Velxio: XIAO boards, the Round Display, Grove and ReSpeaker in your browser