Files
IoTManager/src/items/ButtonInClass.cpp

25 lines
847 B
C++
Raw Normal View History

2020-11-04 23:48:21 +03:00
#include "BufferExecute.h"
2020-09-03 01:12:43 +03:00
#include "items/ButtonInClass.h"
2020-09-02 23:37:11 +03:00
//==========================================Модуль физических кнопок========================================
//button-in switch1 toggle Кнопки Свет 1 pin[2] db[20]
//==========================================================================================================
2020-11-04 23:48:21 +03:00
boolean but[NUM_BUTTONS];
Bounce *buttons = new Bounce[NUM_BUTTONS];
2020-09-03 02:07:12 +03:00
ButtonInClass myButtonIn;
2020-09-02 23:37:11 +03:00
void buttonIn() {
2020-09-03 02:07:12 +03:00
myButtonIn.update();
String key = myButtonIn.gkey();
String pin = myButtonIn.gpin();
2020-09-02 23:37:11 +03:00
sCmd.addCommand(key.c_str(), buttonInSet);
2020-09-03 02:07:12 +03:00
myButtonIn.init();
myButtonIn.switchStateSetDefault();
myButtonIn.clear();
2020-09-02 23:37:11 +03:00
}
void buttonInSet() {
String key = sCmd.order();
String state = sCmd.next();
2020-09-03 02:07:12 +03:00
myButtonIn.switchChangeVirtual(key, state);
2020-09-02 23:37:11 +03:00
}