DOCUMENTATION DEVICES Moddable Zero
Overview
Getting Started
BASE
Reference
Worker
Setup modules
COMMODETTO
Reference
Poco Renderer
Outlines
Creating Fonts
Crypt
Data
DEVICES
Moddable One
Moddable Two
Moddable Three
Moddable Four
Moddable Six
ESP32
ESP8266
nRF52
nRF52 Low Power Notes
Raspberry Pi Pico
M5Core Ink
M5Paper
Wasm
SiLabs Gecko
QCA4020
Moddable Zero
Moddable Display Developer Guide
DISPLAYS
Overview
Adafruit 1.8" ST7735
Adafruit OLED Display
BuyDisplay 2.8" CTP - ESP8266
Crystalfontz ePaper
DotStar
Generic 1.44"
Generic 2.4" & 2.8" (Resistive Touch) - ESP32
Generic 2.4" & 2.8" (Resistive Touch) - ESP8266
Generic 2.4" & 2.8" (Resistive Touch) - Pico
Sharp Memory
Sharp Memory Screen 1.3"
SparkFun TeensyView
Switch Science Reflective LCD
DRIVERS
DESTM32S display
DotStar display
ILI9341 display
LPM013M126A display
LS013B4DN04 display
MCP230XX GPIO expander
NeoStrand
SSD1306 display
SSD1351 display
ST7735 display
Files
IO
TC53 IO
Firmata
NETWORK
Reference
TLS (SecureSocket)
BLE
Ethernet
Web Things
PINS
Reference
Audio Output
PIU
Reference
Localization
Keyboard
Expanding Keyboard
Die Cut
Using After Effects Motion Data
TOOLS
Reference
Manifest
Defines in Manifests
Testing
XS
Handle
JavaScript language considerations on embedded devices using the XS engine
Mods – User Installed Extensions
ROM Colors
Using XS Preload to Optimize Applications
XS Conformance
XS Marshalling
XS Platforms
XS in C
XS linker warnings
xsbug
xst
XS Compartment
XS Profiler
XS Scopes

Moddable Zero Developer Guide

Copyright 2019-2020 Moddable Tech, Inc.
Revised: October 21, 2020

This document provides information about Moddable Zero, including details about its pins and other components, how to build and deploy apps, and links to other development resources.

Table of Contents

About Moddable Zero

Moddable Zero is a hardware module that makes it easy for developers to experiment with the Moddable SDK on inexpensive hardware. Moddable Zero is no longer for sale but continues to be supported. You can follow the instructions here to build your own Moddable Zero, or purchase its replacement, Moddable One.

Components

The two main components of Moddable Zero are the ESP8266 module and resistive touch screen. The ESP8266 module includes a Wi-Fi antenna and 4 MB of flash storage memory. The touch screen is a 240 x 320 QVGA display with 16-bit pixels driven by an ILI9341 display controller and an XPT2046 resistive touch controller.

Pinout

SDK and Host Environment Setup

To build and run apps on Moddable Zero, you'll need to:

  1. Install the Moddable SDK
  2. Install ESP8266 tools
  3. Follow the instructions in the Building and Deploying Apps section below.

Building and Deploying Apps

After you've set up your host environment, take the following steps to install an application on your Moddable Zero.

  1. Attach your Moddable Zero to your computer with a micro USB cable.

    Make sure you're using a data sync–capable cable, not one that is power-only.

  2. Build and deploy the app with mcconfig.

    mcconfig is the command line tool to build and launch Moddable apps on microcontrollers and the simulator. Full documentation of mcconfig is available here.

    Use the platform -p esp/moddable_zero with mcconfig to build for Moddable Zero. For example, to build the piu/balls example:

    cd $MODDABLE/examples/piu/balls
    mcconfig -d -m -p esp/moddable_zero
    

    The examples readme contains additional information about other commonly used mcconfig arguments for screen rotation, Wi-Fi configuration, and more.

Troubleshooting

See the Troubleshooting section of the ESP8266 documentation for a list of common issues and how to resolve them.

Development Resources

Examples

The Moddable SDK has over 150 example apps that demonstrate how to use its many features. The vast majority of these examples run on Moddable Zero.

That said, not every example is compatible with Moddable Zero hardware. For example, the ESP8266 does not have BLE capabilities so BLE examples do not build or run. Some examples are designed to test specific display and touch drivers that are not compatible with the Moddable Zero display and give a build error.

Documentation

All the documentation for the Moddable SDK is in the documentation directory. The documentation, examples, and modules directories share a common structure to make it straightforward to locate information. Some of the highlights include:

  • The commodetto subdirectory, which contains resources related to Commodetto--a bitmap graphics library that provides a 2D graphics API--and Poco, a lightweight rendering engine.
  • The piu subdirectory, which contains resources related to Piu, a user interface framework that makes it easier to create complex, responsive layouts.
  • The networking subdirectory, which contains networking resources related to network sockets and a variety of standard, secure networking protocols built on sockets including HTTP/HTTPS, WebSockets, DNS, SNTP, and telnet
  • The pins subdirectory, which contains resources related to supported hardware protocols (digital, analog, PWM, I2C, etc.). A number of drivers for common off-the-shelf sensors and corresponding example apps are also available.

Support

If you have questions, we recommend you open an issue. We'll respond as quickly as practical, and other developers can offer help and benefit from the answers to your questions. Many questions have already been answered, so please try searching previous issues before opening a new issue.

Updates

The best way to keep up with what we're doing is to follow us on Twitter (@moddabletech). We post announcements about new posts on our blog there, along with other Moddable news.