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

Simpler code

Showing with 5 additions and 8 deletions
+5 -8
...@@ -73,16 +73,13 @@ namespace mqtt { ...@@ -73,16 +73,13 @@ namespace mqtt {
} }
led_effects::onBoardLEDOn(); led_effects::onBoardLEDOn();
Serial.print(F("Message arrived on topic: ")); Serial.print(F("Message arrived on topic: "));
Serial.print(sub_topic); Serial.println(sub_topic);
Serial.print(F(". Message: '")); char command[length + 1];
String messageString;
for (unsigned int i = 0; i < length; i++) { for (unsigned int i = 0; i < length; i++) {
Serial.print((char) message[i]); command[i] = message[i];
messageString += (char) message[i];
} }
Serial.println("'."); command[length] = 0;
sensor_commands::run(messageString.c_str()); sensor_commands::run(command);
delay(50);
led_effects::onBoardLEDOff(); 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