reverting version

This commit is contained in:
Dmitry Borisenko
2020-09-02 22:34:49 +03:00
parent 70096c71c8
commit 2e8ea582d2
286 changed files with 29912 additions and 0 deletions

33
include/Class/Pwm.h Normal file
View File

@@ -0,0 +1,33 @@
#pragma once
#include <Arduino.h>
#include "Class/LineParsing.h"
#include "Global.h"
class Pwm : public LineParsing {
public:
Pwm() : LineParsing(){};
void pwmModeSet() {
if (_pin != "") {
pinMode(_pin.toInt(), INPUT);
}
}
void pwmStateSetDefault() {
if (_state != "") {
pwmChange(_key, _pin, _state);
}
}
void pwmChange(String key, String pin, String state) {
int pinInt = pin.toInt();
analogWrite(pinInt, state.toInt());
eventGen(key, "");
jsonWriteInt(configLiveJson, key, state.toInt());
MqttClient::publishStatus(key, state);
}
};
extern Pwm* myPwm;