From 94b0d23840b3b8fc0997a72b83269e2381885c1e Mon Sep 17 00:00:00 2001 From: Hendrik Langer Date: Mon, 3 Aug 2020 21:35:45 +0200 Subject: [PATCH] display text correctly --- raspberry/roberto/views/frontend/templates/index.html | 1 + trigorilla/src/main.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/raspberry/roberto/views/frontend/templates/index.html b/raspberry/roberto/views/frontend/templates/index.html index fe11dff..3bed61b 100644 --- a/raspberry/roberto/views/frontend/templates/index.html +++ b/raspberry/roberto/views/frontend/templates/index.html @@ -160,6 +160,7 @@ socket.on('data', (data) => { $('form#message').submit(function(event) { gp_socket.emit('text', {data: $('#message_data').val()}); + $('#message_data').val(""); return false; }); }; diff --git a/trigorilla/src/main.cpp b/trigorilla/src/main.cpp index e9d331b..5508538 100644 --- a/trigorilla/src/main.cpp +++ b/trigorilla/src/main.cpp @@ -159,8 +159,9 @@ void loop() Serial.print(values[3]); Serial.print("\n"); } } else if (command.charAt(0) == 'T') { - String message = command.substring(3); + String message = command.substring(2); char* text = message.c_str(); + lcd.clear(); lcd.setCursor(0,2); lcd.print(text); }