Improve debug output in envisens

This commit is contained in:
bzi 2019-03-01 09:14:41 +01:00
parent 414123c87a
commit 2f4ae597f5

View File

@ -115,9 +115,10 @@ bool forcePublish = false;
bool publish (String desc, char *topic, float val, float &lastVal, float diff, bool force){
bool retval = false;
Serial.println("Sample " + desc + ": " + String(val).c_str());
if (checkVariation(val, lastVal, diff) or force) {
lastVal = val;
Serial.println("New " + desc + ": " + String(val).c_str());
Serial.println("Sufficient variation on " + desc + ": " + String(val).c_str());
if (checkPlausibility(val, lastVal, diff) or force) {
Serial.println("Value published");
client.publish(topic, String(val).c_str(), true);