Improve debug output in envisens
This commit is contained in:
parent
414123c87a
commit
2f4ae597f5
@ -115,9 +115,10 @@ bool forcePublish = false;
|
|||||||
|
|
||||||
bool publish (String desc, char *topic, float val, float &lastVal, float diff, bool force){
|
bool publish (String desc, char *topic, float val, float &lastVal, float diff, bool force){
|
||||||
bool retval = false;
|
bool retval = false;
|
||||||
|
Serial.println("Sample " + desc + ": " + String(val).c_str());
|
||||||
if (checkVariation(val, lastVal, diff) or force) {
|
if (checkVariation(val, lastVal, diff) or force) {
|
||||||
lastVal = val;
|
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) {
|
if (checkPlausibility(val, lastVal, diff) or force) {
|
||||||
Serial.println("Value published");
|
Serial.println("Value published");
|
||||||
client.publish(topic, String(val).c_str(), true);
|
client.publish(topic, String(val).c_str(), true);
|
||||||
|
Loading…
Reference in New Issue
Block a user