From 32cd26fccf95402c09d83d2c1be163b4b423a7a8 Mon Sep 17 00:00:00 2001 From: Lewis Jackson <> Date: Thu, 1 Jun 2023 15:12:39 +0300 Subject: [PATCH] Replace inverse smoothstep with regular smoothstep for battery curve --- src/WatchFeatures/Battery.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/WatchFeatures/Battery.cpp b/src/WatchFeatures/Battery.cpp index 2bc0813..c3ff043 100644 --- a/src/WatchFeatures/Battery.cpp +++ b/src/WatchFeatures/Battery.cpp @@ -15,6 +15,7 @@ float WatchFeatures::Battery::GetVoltage() uint8_t WatchFeatures::Battery::GetPercentage() { float voltage = GetVoltage(); + Serial.println(voltage); float level = (GetVoltage() - 3.6f) / 0.6f; if (level < 0.0f) { @@ -23,7 +24,7 @@ uint8_t WatchFeatures::Battery::GetPercentage() level = 1.0f; } - level = 0.5f - sin(asin(1.0f - 2.0f * level) / 3.0f); + level = level * level * (3.0f - 2.0f * level); return std::round(level * 100.0f); }