From 566b96c8b3b19a53d00ed0cfac1899f92d928090 Mon Sep 17 00:00:00 2001 From: Eggert Jung Date: Sat, 2 Apr 2022 16:32:38 +0200 Subject: [PATCH] send dance roll position in percent --- main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 048800e..e6429a1 100644 --- a/main.c +++ b/main.c @@ -88,11 +88,12 @@ void send_info(void){ msg[0] = '0'; mqtt_pub(&mqtt_client, "/Filamentanlage/05_Abzug/state/kraft", msg, strlen(msg)); - ltoa(taenzer_state.pos, msg, 10); + int8_t temp = taenzer_state.pos / 10000; + ltoa(temp, msg, 10); mqtt_pub(&mqtt_client, "/Filamentanlage/05_Abzug/state/speicher/pos", msg, strlen(msg)); sprintf(msg, "%ld", millis()/1000); - mqtt_pub(&mqtt_client, "/Filamentanlage/04_Abzug/state/uptime", msg, strlen(msg)); + mqtt_pub(&mqtt_client, "/Filamentanlage/05_Abzug/state/uptime", msg, strlen(msg)); }