mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-30 20:09:14 +03:00
Добавляем переключатель раоты дисплея
This commit is contained in:
@@ -14,6 +14,8 @@ class Lcd2004 : public IoTItem {
|
|||||||
String _descr;
|
String _descr;
|
||||||
int _prevStrSize;
|
int _prevStrSize;
|
||||||
|
|
||||||
|
bool _isShow = true; // экран показывает
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Lcd2004(String parameters) : IoTItem(parameters) {
|
Lcd2004(String parameters) : IoTItem(parameters) {
|
||||||
String addr, size, xy;
|
String addr, size, xy;
|
||||||
@@ -60,19 +62,37 @@ class Lcd2004 : public IoTItem {
|
|||||||
LCDI2C->noBacklight();
|
LCDI2C->noBacklight();
|
||||||
else if (command == "backlight")
|
else if (command == "backlight")
|
||||||
LCDI2C->backlight();
|
LCDI2C->backlight();
|
||||||
else if (command == "noDisplay")
|
else if (command == "noDisplay") {
|
||||||
LCDI2C->noDisplay();
|
LCDI2C->noDisplay();
|
||||||
else if (command == "display")
|
_isShow = false;
|
||||||
|
} else if (command == "display") {
|
||||||
LCDI2C->display();
|
LCDI2C->display();
|
||||||
else if (command == "x") {
|
_isShow = true;
|
||||||
|
} else if (command == "toggle") {
|
||||||
|
if (_isShow) {
|
||||||
|
LCDI2C->noDisplay();
|
||||||
|
_isShow = false;
|
||||||
|
} else {
|
||||||
|
LCDI2C->display();
|
||||||
|
_isShow = true;
|
||||||
|
}
|
||||||
|
} else if (command == "x") {
|
||||||
|
if (param.size()) {
|
||||||
_x = param[0].valD;
|
_x = param[0].valD;
|
||||||
|
}
|
||||||
} else if (command == "y") {
|
} else if (command == "y") {
|
||||||
|
if (param.size()) {
|
||||||
_y = param[0].valD;
|
_y = param[0].valD;
|
||||||
|
}
|
||||||
} else if (command == "descr") {
|
} else if (command == "descr") {
|
||||||
|
if (param.size()) {
|
||||||
_descr = param[0].valS;
|
_descr = param[0].valS;
|
||||||
|
}
|
||||||
} else if (command == "id2show") {
|
} else if (command == "id2show") {
|
||||||
|
if (param.size()) {
|
||||||
_id2show = param[0].valS;
|
_id2show = param[0].valS;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
doByInterval();
|
doByInterval();
|
||||||
return {};
|
return {};
|
||||||
|
|||||||
Reference in New Issue
Block a user