Copyright 2017-2021 Moddable Tech, Inc.
Revised: November 3, 2021
These examples use various sensor, display, and touch drivers available in the Moddable SDK. This document provides a brief description of each example and components supported. The source code for each driver is located in the $MODDABLE/modules/drivers directory.
HTTP server that returns a JPEG image captured from the ArduCAM Mini 2MP SPI camera.
HTTP client that posts successive JPEG images captured from the ArduCAM Mini 2MP SPI camera to an HTTP server.
Displays a raw 16-bit RGB image captured from the ArduCAM Mini 2MP SPI camera.
HTTP server that returns a JPEG image captured from the ArduCAM Mini 2MP SPI camera as a multipart HTTP response. The HTTP client can optionally specify the image width and height in the request.
HTTP server that returns a text reading from an I2C Bosch BMP180 Barometric Pressure/Temperature sensor. The application additionally configures the host as a Wi-Fi base station.
Reads the BMP280 Temperature/Humidity sensor.
Progressively renders each row of a color image to an Adafruit DotStar 144 LED strip. The driver communicates with the strip over SPI.
Calibration application for FT6206 touch screen on Moddable One and Moddable Two.
Reads ambient and UV light measurements from the dual-mode Sharp UV Light Sensor. The application configures the sensor operating mode. The driver communicates with the sensor over I2C using the SMBus protocol.
Reads distance measurements at 100ms intervals from the Sharp Time-of-Flight Laser Ranging Sensor. The driver communicates with the sensor over I2C.
Demonstrates use of the the Hitachi HD44780 character LCD module.
Reads digital compass measurements at 250ms intervals from the I2C SparkFun Triple Axis Magnetometer Breakout - HMC5883L.
Demonstrates use of the the HX711 Load Cell Amplifier to measure weight.
Demonstrates how to use both the touch pad buttons and push buttons on the ESP32‑S2 powered Kaluga board.
For more information about the Kaluga board, see this blog post.
Reads the Adafruit LIS3DH Triple-Axis Accelerometer at 100ms intervals. The driver communicates with the accelerometer over I2C.
Commodetto app that displays Adafruit LIS3DH Triple-Axis Accelerometer sensor values in real time and animates a bouncing ball based on the X and Y readings.
Commodetto app for Silicon Labs Gecko devices. Demonstrates use of this Sharp mirror display and deep sleep modes.
A simple example to demonstrate built-in hardware features of the M5Atom Echo development board.
A simple example to demonstrate built-in hardware features of the M5Atom Lite development board.
A simple example to demonstrate built-in hardware features of the M5Atom Matrix development board.
Draws a basic digital clock on an ePaper display that updates once a minute. Only runs on M5 Paper and M5Core Ink because they are battery powered. Uses special power management techniques, including one to eliminate drawing flicker on the M5Core Ink.
See the blog post Getting the Most from ePaper Displays for more information about this example.
Commodetto app for the M5Stack Fire. Visualizes device movement based on data from the on-board InvenSense MPU-6050 accelerometer/gyro and Xtrinsic MAG3110 magnetometer.
Commodetto app for the M5Stick-C. Demonstrates how to change the screen brightness to save power.
Commodetto app for the M5Stick-C. Visualizes device movement based on data from the on-board SH200Q accelerometer/gyro.
Commodetto app for the M5Stick-C. Combines the built-in screen and accelerometer on the M5Stick-C to create a simple pedometer.
Commodetto app for the M5Stick-C. Demonstrates using the RTC BM8563 on the version 2 of the hardware.
Leverages the MCP23008 GPIO expander to control multiple LEDs from a single I2C device.
Leverages the MCP23017 GPIO expander to control multiple LEDs from a single I2C device.
Demonstrates use of the Moddable SDK NeoPixel API. This API works on ESP32 boards with integrated NeoPixels such as the M5Stack Fire or Lily Go TAudio, or you can combine an ESP32 board (like the NodeMCU ESP32) with a NeoPixel board from AdaFruit or Sparkfun. For more details, see this blog post.
ESP32 example that animates WS2811 string lights. Making request to HTTP server switches between effects. For more information on this example and how to incorporate Neostrands into your projects, see this blog post.
Reads the temperature from one or more DS18X20 temperature sensors connected to the ESP8266 or ESP32. Tested with the DS18B20 and DS18S20 Digital temperature sensors. These sensors use the Dallas 1-Wire protocol, so they require just one digital pin for communication. Multiple sensors may be connected to the same pin.
A set of examples to demonstrate use of a real-time clock (RTC).
Reads the Sharp Temperature and Humidity sensor at 100ms intervals. The driver communicates with the sensor over I2C.
Demonstrates use of a SparkFun Qwiic Twist (a digital RGB rotary encoder). Displays the numbers of twists and presses of the encoder and allows you to change its color using an onscreen color picker.
Demonstrates how to use the Mighty Gecko radio.
Renders bitmaps on ePaper displays compatible with the DESTM32S SPI ePaper display controller, e.g. the Crystalfontz 128x296 3-Color ePaper Module.
Demonstrates how to interface with the Sakura IO LTE module to send/receive packets and read module status. The driver communicates with the sensor over I2C.
A set of examples for the following sensors, written in the TC53 IO Class Pattern.
aht10
am2320
bmp180
bmp280
capacitiveMoisture
ccs811
hmc5883
htu21d
l3gd20
lis3dh
lm75
lsm303dlhc
mlx90614
mpu6050
mpu9250
ntcThermistor
sht3x
shtc3
si7020
tmp102
tmp117
urm09
zioQwiicSoilMoisture
Reads the SI7021 Temperature/Humidity sensor. This sensor is built into many of the Silicon Labs dev kits.
A collection of example apps for the Sonoff B1 lightbulb. For more information on installing Moddable SDK applications on the Sonoff B1, see this blog post.
Commodetto app that fills the screen with shades of gray. Works on SSD1306-compatible displays, such as the SparkFun TeensyView.
Reads the Texas Instruments TMP102 digital temperature sensor at 100ms intervals over I2C.
Commodetto app that calibrates the XPT2046 touch screen controller used by the Moddable Zero device. The app saves the calibration data in persistent storage.