diff --git a/ESP32/src/DataLogger.h b/ESP32/src/DataLogger.h index a0814bb..cadae50 100644 --- a/ESP32/src/DataLogger.h +++ b/ESP32/src/DataLogger.h @@ -12,11 +12,11 @@ public: bool isDifferent(const Entry& other) { - const float scale = speed > 0.0f ? 1.0f : 5.0f; + const float scale = speed > 0.0f || other.speed > 0.0f ? 1.0f : 5.0f; return std::abs(batteryVoltage - other.batteryVoltage) > 0.1f * scale - && std::abs(batteryOutputCurrent - other.batteryOutputCurrent) > 0.1f * scale - && std::abs(speed - other.speed) > 0.1f; + || std::abs(batteryOutputCurrent - other.batteryOutputCurrent) > 0.1f * scale + || std::abs(speed - other.speed) > 0.1f; } };