2.2 Firmware Implementation
The firmware is developed in MPLAB X IDE v6.20 using MCC 5.5.1.
From a firmware point of view, there are four possible control methods of the light intensity:
- Intensity is directly set by the user through MQTT or serial.
- Motion sensor is enabled and it controls the light intensity.
- The ambient light sensor is enabled and it controls the intensity.
- Both motion and ambient light sensors are enabled and control the light intensity. In this particular case, the light will dim when no movement is detected, even if the ambient light is low.
The software block diagram is given below:
The firmware is divided into the following tasks:
- Application Task – It also calls LTE IoT task if user activates it through console command.
- DALI Task
- MQTT Task