Add new actuator : PWM controller (#737)

* Initial generalization from a PWM LED controller, to a PWM controller.
Allow the config file to set the name of each channel and the number of channels.
Fade time is now per-channel, so MQTT messages can genuinely set an individual channel, and specify the fade time for that channel.
The default gamma is configurable in the config.
This commit is contained in:
Oli Wright authored and GitHub committed 2020-09-02 11:17:36 -05:00
1 parent 7b9944d1ca
commit ef39e14497
6 files changed
+374 -3

No files matched your search

+15
View File
@@ -125,6 +125,9 @@ unsigned long timer_sys_measures = 0;
#ifdef ZactuatorFASTLED
# include "config_FASTLED.h"
#endif
#ifdef ZactuatorPWM
# include "config_PWM.h"
#endif
#if defined(ZboardM5STICKC) || defined(ZboardM5STACK)
# include "config_M5.h"
#endif
@@ -630,6 +633,9 @@ void setup() {
#ifdef ZactuatorFASTLED
setupFASTLED();
#endif
#ifdef ZactuatorPWM
setupPWM();
#endif
#ifdef ZsensorDS1820
setupZsensorDS1820();
#endif
@@ -1201,6 +1207,9 @@ void loop() {
#endif
#ifdef ZactuatorFASTLED
FASTLEDLoop();
#endif
#ifdef ZactuatorPWM
PWMLoop();
#endif
} else {
connectMQTT();
@@ -1331,6 +1340,9 @@ void stateMeasures() {
# ifdef ZactuatorFASTLED
modules = modules + ZactuatorFASTLED;
# endif
# ifdef ZactuatorPWM
modules = modules + ZactuatorPWM;
# endif
# ifdef ZboardM5STACK
M5.Power.begin();
SYSdata["m5-batt-level"] = (int8_t)M5.Power.getBatteryLevel();
@@ -1456,6 +1468,9 @@ void receivingMQTT(char* topicOri, char* datacallback) {
# ifdef ZactuatorFASTLED
MQTTtoFASTLED(topicOri, jsondata);
# endif
# ifdef ZactuatorPWM
MQTTtoPWM(topicOri, jsondata);
# endif
# if defined(ZboardM5STICKC) || defined(ZboardM5STACK)
MQTTtoM5(topicOri, jsondata);
# endif