-
Notifications
You must be signed in to change notification settings - Fork 356
Customizing the build
This example shows how to modify the "ESP Thing" build, whether building in Arduino or using PlatformIO. By default, the "ESP Thing" is configured with six parallel outputs, with 50 pixels connected to each output.
For illustrative purposes, this page will modify the number of pixels attached to each of the outputs. Because the intent is to educate, a unique prime number will be used for each output.
In the Arduino environment, you simply edit config.h as follows:
You would replace line 28 with the following contents:
#define PRODUCT_ESP8266_THING // select the product to build
#define NUM_PIXELS 72 // Total number of pixels on all ports
#define PIXELS_ON_DATA_PIN_1 5 // Let's put a prime number of pixels on each data pin...
#define PIXELS_ON_DATA_PIN_2 7
#define PIXELS_ON_DATA_PIN_3 11
#define PIXELS_ON_DATA_PIN_4 13
#define PIXELS_ON_DATA_PIN_5 17
#define PIXELS_ON_DATA_PIN_6 19
// add other changes as you'd like
// see "./include/configs/product/product_template.h"
// for documentation on the various configuration
// options.
PlatformIO allows you to add custom build environments
via the file platformio_override.ini
. Just create it
in the root of the depot, with the following contents:
[env:custom_esp_thing_older]
platform = ${common.platform_default}
platform_packages = ${common.platform_packages}
lib_deps = ${esp8266.lib_deps}
board = d1_mini
board_build.ldscript = ${common.ldscript_4m1m}
build_unflags = ${common.build_unflags}
build_flags =
${common.build_flags_esp8266}
-D PRODUCT_ESP8266_THING
-D NUM_PIXELS=72
-D PIXELS_ON_DATA_PIN_1=5
-D PIXELS_ON_DATA_PIN_2=7
-D PIXELS_ON_DATA_PIN_3=11
-D PIXELS_ON_DATA_PIN_4=13
-D PIXELS_ON_DATA_PIN_5=17
-D PIXELS_ON_DATA_PIN_6=19
Then, manually refresh the PlatformIO project list:
That's all. Your custom build environment will appear, and expanding it will give you the same options to build / upload file system / etc.
An example platform_override.ini
is checked in.
The list of "products" that have predefined behavior can be found in config.h
.
Documentation for supported #define
values can be found in include/configs/product/template.h
.
You can review the defaults that are in use for "ESP Thing" in its
product specific config file at include/configs/product/esp8266_thing.h
.