From eded0f89da34bae907e6ad9489afb8ed477a15e3 Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Wed, 16 Aug 2017 23:44:52 +0200 Subject: [PATCH] beautify output of vcc --- sketch_aug14a/sketch_aug14a.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sketch_aug14a/sketch_aug14a.ino b/sketch_aug14a/sketch_aug14a.ino index 6b3f92a..0d9a925 100644 --- a/sketch_aug14a/sketch_aug14a.ino +++ b/sketch_aug14a/sketch_aug14a.ino @@ -152,6 +152,8 @@ void read_thermometer() { uint16_t vcc = ESP.getVcc(); + uint16_t v1 = vcc / 1000; + uint16_t v2 = (vcc - v1 * 1000); #ifdef DEBUG Serial.print(vcc); Serial.println(); @@ -163,7 +165,7 @@ void read_thermometer() { //char topic[128]; //snprintf(topic, 127, "IoT/espThermometer2/%s/measurement", WiFi.macAddress().c_str()); char payload[128]; - snprintf(payload, 127, "%s %d.%d %ld %ld", clientId, t1, t2, vcc, duration); + snprintf(payload, 127, "%s %d.%d %d.%d %ld", clientId, t1, t2, v1, v2, duration); #ifdef DEBUG Serial.println(payload); #endif