|
1 | 1 | # Moddable SDK - Driver Examples |
2 | 2 |
|
3 | | -Copyright 2017 Moddable Tech, Inc. |
| 3 | +Copyright 2017-2019 Moddable Tech, Inc.<BR> |
| 4 | +Revised: August 23, 2019 |
4 | 5 |
|
5 | | -<!-- Last edit: 12/6/2017 BSF --> |
| 6 | +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](../../modules/drivers) directory. |
6 | 7 |
|
7 | | -Revised: December 6, 2017 |
| 8 | +*** |
8 | 9 |
|
9 | | -These examples demonstrate how to use the Moddable SDK to write drivers and applications that interface with a variety of components. This document provides a brief description of each example and components supported. |
| 10 | +### [`arducamframeserver`](./arducamframeserver) |
10 | 11 |
|
11 | | -> **Note**: This document assumes you have installed the Moddable SDK on your development machine. The [Getting Started](../../documentation/Moddable%20SDK%20-%20Getting%20Started.md) document describes how to install the SDK. |
| 12 | +HTTP server that returns a JPEG image captured from the [ArduCAM Mini 2MP SPI camera](http://www.arducam.com/arducam-mini-released/). |
12 | 13 |
|
13 | | -### [arducamframeserver](./arducamframeserver) |
| 14 | +*** |
14 | 15 |
|
15 | | -HTTP server that returns a JPEG image captured from the [ArduCAM Mini 2MP SPI camera](http://www.arducam.com/arducam-mini-released/). |
| 16 | +### [`arducamhttpput`](./arducamhttpput) |
16 | 17 |
|
17 | | -### [arducamhttpput](./arducamhttpput) |
| 18 | +HTTP client that posts successive JPEG images captured from the [ArduCAM Mini 2MP SPI camera](http://www.arducam.com/arducam-mini-released/) to an HTTP server. |
18 | 19 |
|
19 | | -HTTP client that posts successive JPEG images captured from the [ArduCAM Mini 2MP SPI camera](http://www.arducam.com/arducam-mini-released/) to a HTTP server. |
| 20 | +*** |
20 | 21 |
|
21 | | -### [arducampreview](./arducampreview) |
| 22 | +### [`arducampreview`](./arducampreview) |
22 | 23 |
|
23 | | -Displays a raw 16-bit RGB image captured from the [ArduCAM Mini 2MP SPI camera](http://www.arducam.com/arducam-mini-released/) on a LCD screen compatible with the [ILI9341](../../modules/drivers/ili9341) driver. |
| 24 | +Displays a raw 16-bit RGB image captured from the [ArduCAM Mini 2MP SPI camera](http://www.arducam.com/arducam-mini-released/). |
24 | 25 |
|
25 | | -### [arducamstreamserver](./arducamstreamserver) |
| 26 | +*** |
| 27 | + |
| 28 | +### [`arducamstreamserver`](./arducamstreamserver) |
26 | 29 |
|
27 | 30 | HTTP server that returns a JPEG image captured from the [ArduCAM Mini 2MP SPI camera](http://www.arducam.com/arducam-mini-released/) as a multipart HTTP response. The HTTP client can optionally specify the image width and height in the request. |
28 | 31 |
|
29 | | -### [BMP180](./BMP180) |
| 32 | +*** |
| 33 | + |
| 34 | +### [`BMP180`](./BMP180) |
30 | 35 |
|
31 | 36 | HTTP server that returns a text reading from an I<sup>2</sup>C [Bosch BMP180 Barometric Pressure/Temperature sensor](https://www.adafruit.com/product/1603). The application additionally configures the host as a Wi-Fi base station. |
32 | 37 |
|
33 | | -### [dotstar](./dotstar) |
| 38 | +*** |
| 39 | + |
| 40 | +### [`bmp280`](./bmp280) |
| 41 | + |
| 42 | +Reads the [BMP280 Temperature/Humidity sensor](https://www.adafruit.com/product/2651). |
| 43 | + |
| 44 | +*** |
| 45 | + |
| 46 | +### [`dotstar`](./dotstar) |
34 | 47 |
|
35 | 48 | Progressively renders each row of a color image to an [Adafruit DotStar 144 LED strip](https://www.adafruit.com/product/2242). The [driver](../../modules/drivers/dotstar) communicates with the strip over SPI. |
36 | 49 |
|
37 | | -### [ga1auv100wp](./ga1auv100wp) |
| 50 | +*** |
| 51 | + |
| 52 | +### [`ga1auv100wp`](./ga1auv100wp) |
38 | 53 | Reads ambient and UV light measurements from the dual-mode [Sharp UV Light Sensor](http://www.sharp-world.com/products/device/lineup/selection/opto/receiving_light/opic/ultraviolet/index.html). The application configures the sensor operating mode. The [driver](../../modules/drivers/ga1auv100wp) communicates with the sensor over I<sup>2</sup>C using the SMBus protocol. |
39 | 54 |
|
40 | | -### [gp2ap01vt00f](./gp2ap01vt00f) |
| 55 | +*** |
| 56 | + |
| 57 | +### [`gp2ap01vt00f`](./gp2ap01vt00f) |
41 | 58 | Reads distance measurements at 100ms intervals from the [Sharp Time-of-Flight Laser Ranging Sensor](http://www.sunnic.com/upfiles/tw_/sharp/GP2AP01VT00F.pdf). The [driver](../../modules/drivers/gp2ap01vt00f) communicates with the sensor over I<sup>2</sup>C. |
42 | 59 |
|
43 | | -### [HMC5883L](./HMC5883L) |
| 60 | +*** |
| 61 | + |
| 62 | +### [`HD44780i-i2c`](./HD44780i-i2c) |
| 63 | + |
| 64 | +Demonstrates use of the the Hitachi HD44780 character LCD module. |
| 65 | + |
| 66 | +*** |
| 67 | + |
| 68 | +### [`HMC5883L`](./HMC5883L) |
44 | 69 |
|
45 | 70 | Reads digital compass measurements at 250ms intervals from the I<sup>2</sup>C [SparkFun Triple Axis Magnetometer Breakout - HMC5883L](https://www.sparkfun.com/products/retired/10530). |
46 | | -### [lis3dh](./lis3dh) |
| 71 | +*** |
| 72 | + |
| 73 | +### [`lis3dh`](./lis3dh) |
47 | 74 |
|
48 | 75 | Reads the [Adafruit LIS3DH Triple-Axis Accelerometer](https://www.adafruit.com/product/2809) at 100ms intervals. The [driver](../../modules/drivers/lis3dh) communicates with the accelerometer over I<sup>2</sup>C. |
49 | 76 |
|
50 | | -### [lis3dhball](./lis3dhball) |
| 77 | +*** |
| 78 | + |
| 79 | +### [`lis3dhball`](./lis3dhball) |
51 | 80 |
|
52 | 81 | [Commodetto](../../documentation/commodetto/commodetto.md) app that displays [Adafruit LIS3DH Triple-Axis Accelerometer](https://www.adafruit.com/product/2809) sensor values in real time and animates a bouncing ball based on the X and Y readings. |
53 | 82 |
|
54 | | -### [mcp23008](./mcp23008) |
| 83 | +*** |
| 84 | + |
| 85 | +### [`ls013b4dn04`](./ls013b4dn04) |
| 86 | + |
| 87 | +[Commodetto](../../documentation/commodetto/commodetto.md) app for Silicon Labs Gecko devices. Demonstrates use of [this Sharp mirror display](../../documentation/displays/wiring-guide-sharp-memory-1.3-spi.md) and deep sleep modes. |
| 88 | + |
| 89 | +*** |
| 90 | + |
| 91 | +### [`m5stack-imu`](./m5stack-imu) |
| 92 | + |
| 93 | +[Commodetto](../../documentation/commodetto/commodetto.md) app for the [M5Stack Fire](https://www.aliexpress.com/item/32847906756.html?spm=2114.12010615.8148356.14.11c127aeBNzJBb). Visualizes device movement based on data from the on-board InvenSense MPU-6050 accelerometer/gyro and Xtrinsic MAG3110 magnetometer. |
| 94 | + |
| 95 | +*** |
| 96 | + |
| 97 | +### [`m5stickc-axp192`](./m5stickc-axp192) |
| 98 | + |
| 99 | +[Commodetto](../../documentation/commodetto/commodetto.md) app for the [M5Stick-C](https://www.adafruit.com/product/4290). Demonstrates how to change the screen brightness to save power. |
| 100 | + |
| 101 | +*** |
| 102 | + |
| 103 | +### [`m5stickc-imu`](./m5stickc-imu) |
| 104 | + |
| 105 | +[Commodetto](../../documentation/commodetto/commodetto.md) app for the [M5Stick-C](https://www.adafruit.com/product/4290). Visualizes device movement based on data from the on-board SH200Q accelerometer/gyro. |
| 106 | + |
| 107 | +*** |
| 108 | + |
| 109 | +### [`m5stickc-pedometer`](./m5stickc-pedometer) |
| 110 | + |
| 111 | +[Commodetto](../../documentation/commodetto/commodetto.md) app for the [M5Stick-C](https://www.adafruit.com/product/4290). Combines the built-in screen and accelerometer on the [M5Stick-C](https://www.adafruit.com/product/4290) to create a simple pedometer. |
| 112 | + |
| 113 | +*** |
| 114 | + |
| 115 | +### [`mcp23008`](./mcp23008) |
55 | 116 |
|
56 | | -Leverages the [MCP23008 GPIO expander](https://www.adafruit.com/product/593) to control up to eight LEDs from a single I<sup>2</sup>C [device](../../modules/drivers/mcp23008). |
| 117 | +Leverages the [MCP23008 GPIO expander](https://www.adafruit.com/product/593) to control multiple LEDs from a single I<sup>2</sup>C device. |
57 | 118 |
|
58 | | -### [qm1h0p0073](./qm1h0p0073) |
| 119 | +*** |
| 120 | + |
| 121 | +### [`mcp23017`](./mcp23017) |
| 122 | + |
| 123 | +Leverages the [MCP23017 GPIO expander](https://www.adafruit.com/product/732) to control multiple LEDs from a single I<sup>2</sup>C device. |
| 124 | + |
| 125 | + |
| 126 | +*** |
| 127 | + |
| 128 | +### [`neopixel`](./neopixel) |
| 129 | + |
| 130 | +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](https://blog.moddable.com/blog/neopixels/). |
| 131 | + |
| 132 | +*** |
| 133 | + |
| 134 | +### [`neostrand`](./neostrand/docExample) |
| 135 | + |
| 136 | +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](https://blog.moddable.com/blog/a-very-neopixel-christmas/). |
| 137 | + |
| 138 | +*** |
| 139 | + |
| 140 | +### [`onewire`](./onewire) |
| 141 | + |
| 142 | +Reads the temperature from one or more DS18X20 temperature sensors connected to the ESP8266 or ESP32. Tested with the [DS18B20](https://www.adafruit.com/product/374) and [DS18S20](https://www.mouser.com/ProductDetail/Maxim-Integrated/DS18S20%2BTR?qs=7H2Jq%252byxpJJMRp9%252bZx3PtA%3D%3D&gclid=EAIaIQobChMIwZzuu9OZ5AIViMBkCh0aoQ4tEAAYAiAAEgIZjfD_BwE) 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. |
| 143 | + |
| 144 | +*** |
| 145 | + |
| 146 | +### [`qm1h0p0073`](./qm1h0p0073) |
59 | 147 | Reads the [Sharp Temperature and Humidity sensor](http://www.sharp-world.com/products/device/lineup/selection/rf/tem_hum/index.html) at 100ms intervals. The [driver](../../modules/drivers/qm1h0p0073) communicates with the sensor over I<sup>2</sup>C. |
60 | 148 |
|
61 | | -### [redandblack](./redandblack) |
| 149 | +*** |
| 150 | + |
| 151 | +### [`radiotest`](./radio/radiotest) |
| 152 | + |
| 153 | +Demonstrates how to use the [Mighty Gecko](https://www.silabs.com/products/development-tools/wireless/mesh-networking/mighty-gecko-starter-kit) radio. |
| 154 | + |
| 155 | +*** |
| 156 | + |
| 157 | +### [`redandblack`](./redandblack) |
62 | 158 | Renders bitmaps on ePaper displays compatible with the [DESTM32S](../../modules/drivers/destm32s) SPI ePaper display controller, e.g. the [Crystalfontz 128x296 3-Color ePaper Module](https://www.crystalfontz.com/product/cfap128296d00290-128x296-epaper-display). |
63 | 159 |
|
64 | | -### [sakuraio](./sakuraio) |
| 160 | +*** |
| 161 | + |
| 162 | +### [`sakuraio`](./sakuraio) |
65 | 163 | Demonstrates how to interface with the [Sakura IO LTE module](http://python-sakuraio.readthedocs.io/en/latest/index.html) to send/receive packets and read module status. The [driver](../../modules/drivers/sakuraio) communicates with the sensor over I<sup>2</sup>C. |
66 | 164 |
|
67 | | -### [TMP102](./TMP102) |
68 | | -Reads the [Texas Instruments TMP102 digital temperature sensor](https://www.sparkfun.com/products/13314) at 333ms intervals over I<sup>2</sup>C. |
| 165 | +*** |
| 166 | + |
| 167 | +### [`si7021`](./si7021) |
| 168 | + |
| 169 | +Reads the [SI7021 Temperature/Humidity sensor](https://www.adafruit.com/product/3251). This sensor is built into many of the Silicon Labs dev kits. |
| 170 | + |
| 171 | +*** |
| 172 | + |
| 173 | +### [`sonoffb1`](./sonoffb1) |
| 174 | + |
| 175 | +A collection of example apps for the [Sonoff B1 lightbulb](https://sonoff.ie/sonoff/54-sonoff-b1.html). For more information on installing Moddable SDK applications on the Sonoff B1, see [this blog post](https://blog.moddable.com/blog/hacking-sonoff-b1/). |
69 | 176 |
|
70 | | -### [xpt2046calibrate](./xpt2046calibrate) |
| 177 | +*** |
| 178 | + |
| 179 | +### [`ssd1306`](./ssd1306) |
| 180 | + |
| 181 | +[Commodetto](../../documentation/commodetto/commodetto.md) app that fills the screen with shades of gray. Works on SSD1306-compatible displays, such as the [SparkFun TeensyView](../../documentation/displays/wiring-guide-sparkFun-teensyview-spi.md). |
| 182 | + |
| 183 | +*** |
| 184 | + |
| 185 | +### [`TMP102`](./TMP102) |
| 186 | +Reads the [Texas Instruments TMP102 digital temperature sensor](https://www.sparkfun.com/products/13314) at 100ms intervals over I<sup>2</sup>C. |
| 187 | + |
| 188 | +*** |
| 189 | + |
| 190 | +### [`xpt2046calibrate`](./xpt2046calibrate) |
71 | 191 | [Commodetto](../../documentation/commodetto/commodetto.md) app that calibrates the [XPT2046 touch screen controller](../../modules/drivers/xpt2046) used by the [Moddable Zero](../../documentation/etc/moddablezero.md) device. The app saves the calibration data in persistent storage. |
| 192 | + |
| 193 | +*** |
0 commit comments