Implementation
Having discussed the solution architecture, next, we will look at the firmware for each device. Let's retain the order we used while discussing the solution and start with the light sensor.
Light sensor
Here, we will integrate a TLS2561 light sensor module into the light sensor device and use an LED as the indicator during provisioning. The following Fritzing diagram shows the connections:
Let's prepare the development environment before coding. Here are the steps:
- Create a PlatformIO project with the following
platformio.ini
file:[env:az-delivery-devkit-v4] platform = espressif32 board = az-delivery-devkit-v4 framework = espidf monitor_speed = 115200 lib_extra_dirs =     ../../common/esp-idf-lib/components     ../common build_flags =     -DCONFIG_I2CDEV_TIMEOUT=100000
lib_extra_dirs
shows the directories of the external...