mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-28 07:02:17 +03:00
devide into files
This commit is contained in:
24
src/items/mPwmOut.cpp
Normal file
24
src/items/mPwmOut.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#include "items/itemsGlobal.h"
|
||||
#include "Class/Pwm.h"
|
||||
//==========================================Модуль управления ШИМ===================================================
|
||||
//pwm-out volume range Кнопки Свет 1 pin[12] st[500]
|
||||
//==================================================================================================================
|
||||
void pwmOut() {
|
||||
myPwm = new Pwm();
|
||||
myPwm->update();
|
||||
String key = myPwm->gkey();
|
||||
String pin = myPwm->gpin();
|
||||
String inv = myPwm->ginv();
|
||||
sCmd.addCommand(key.c_str(), pwmOutSet);
|
||||
jsonWriteStr(configOptionJson, key + "_pin", pin);
|
||||
myPwm->pwmModeSet();
|
||||
myPwm->pwmStateSetDefault();
|
||||
myPwm->clear();
|
||||
}
|
||||
|
||||
void pwmOutSet() {
|
||||
String key = sCmd.order();
|
||||
String state = sCmd.next();
|
||||
String pin = jsonReadStr(configOptionJson, key + "_pin");
|
||||
myPwm->pwmChange(key, pin, state);
|
||||
}
|
||||
Reference in New Issue
Block a user