Merge pull request #231 from biveraxe/ver4dev

Делаем округление для всех кнопок равной 0
This commit is contained in:
2022-11-07 13:24:55 +03:00
committed by GitHub
3 changed files with 5 additions and 1 deletions

View File

@@ -23,6 +23,7 @@ class ButtonIn : public IoTItem {
jsonRead(parameters, "pinMode", _pinMode); jsonRead(parameters, "pinMode", _pinMode);
jsonRead(parameters, "debounceDelay", _debounceDelay); jsonRead(parameters, "debounceDelay", _debounceDelay);
jsonRead(parameters, "fixState", _fixState); jsonRead(parameters, "fixState", _fixState);
_round = 0;
//Serial.printf("vvvvvvvvvvvvvvvv =%d \n", _fixState); //Serial.printf("vvvvvvvvvvvvvvvv =%d \n", _fixState);
IoTgpio.pinMode(_pin, INPUT); IoTgpio.pinMode(_pin, INPUT);

View File

@@ -12,6 +12,7 @@ class ButtonOut : public IoTItem {
ButtonOut(String parameters): IoTItem(parameters) { ButtonOut(String parameters): IoTItem(parameters) {
jsonRead(parameters, "pin", _pin); jsonRead(parameters, "pin", _pin);
jsonRead(parameters, "inv", _inv); jsonRead(parameters, "inv", _inv);
_round = 0;
IoTgpio.pinMode(_pin, OUTPUT); IoTgpio.pinMode(_pin, OUTPUT);
IoTgpio.digitalWrite(_pin, value.valD?HIGH:LOW); IoTgpio.digitalWrite(_pin, value.valD?HIGH:LOW);

View File

@@ -4,7 +4,9 @@
class VButton : public IoTItem { class VButton : public IoTItem {
public: public:
VButton(String parameters): IoTItem(parameters) { } VButton(String parameters): IoTItem(parameters) {
_round = 0;
}
void setValue(const IoTValue& Value, bool genEvent = true) { void setValue(const IoTValue& Value, bool genEvent = true) {
value = Value; value = Value;