Commit 34cf4989 authored by Eric Duminil's avatar Eric Duminil
Browse files

Simpler code

parent 6baf3b30
......@@ -73,16 +73,13 @@ namespace mqtt {
}
led_effects::onBoardLEDOn();
Serial.print(F("Message arrived on topic: "));
Serial.print(sub_topic);
Serial.print(F(". Message: '"));
String messageString;
Serial.println(sub_topic);
char command[length + 1];
for (unsigned int i = 0; i < length; i++) {
Serial.print((char) message[i]);
messageString += (char) message[i];
command[i] = message[i];
}
Serial.println("'.");
sensor_commands::run(messageString.c_str());
delay(50);
command[length] = 0;
sensor_commands::run(command);
led_effects::onBoardLEDOff();
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment