Added, tested

This commit is contained in:
2021-11-29 21:12:35 +01:00
parent d5bd755754
commit a9e6126e8f
4 changed files with 80 additions and 25 deletions

View File

@@ -164,6 +164,7 @@ void setup()
setup_matrix();
scroller.init();
scroller.SetColors(colors);
scroller.SetMatrix(matrix);
@@ -242,7 +243,7 @@ boolean reconnect() {
void decode_payload(String msg)
{
StringSplitter *splitter = new StringSplitter(msg, ';', 2);
/*StringSplitter *splitter = new StringSplitter(msg, ';', 2);
int n = 0;
int i = 0;
String s,m;
@@ -266,16 +267,16 @@ void decode_payload(String msg)
if (cmd == "on") on = param.toInt();
}
}
i = scroller.AddLine(m);
if (n == 2) {
*/
scroller.AddLine(msg);
/*if (n == 2) {
Serial.printf("color=%d,brightness=%d,off=%d,on=%d,speed=%d\n",color,brightness,off,on,speed);
scroller.SetParameters(i,color,brightness,off,on,speed);
}
}*/
}
void callback(char* topic, byte* payload, unsigned int length) {
char msg[128];
char msg[256];
Serial.print("Message arrived [");
Serial.print(topic);
@@ -292,8 +293,8 @@ void callback(char* topic, byte* payload, unsigned int length) {
msg[length] = '\0';
// Switch on the LED if an 1 was received as first character
scroller.TurnOff();
scroller.DeleteLines();
//scroller.TurnOff();
//scroller.DeleteLines();
decode_payload(msg);
showTextMqtt = true;
} else if (String("get/home/sensor/decka/bme280") == String(topic)) {