Merge pull request #38 from janecker/scale_debouncing

Adds slight debouncing to the scale loop weight logic
This commit is contained in:
ManuelW authored and GitHub committed 2025-07-22 06:32:31 +02:00
commit 9c06fe6725
1 file changed
+5 -1
+5 -1
View File
@@ -74,7 +74,11 @@ void scale_loop(void * parameter) {
scaleTareRequest = false;
}
weight = round(scale.get_units());
// Only update weight if median changed more than 1
int16_t newWeight = round(scale.get_units());
if(abs(weight-newWeight) > 1){
weight = newWeight;
}
}
vTaskDelay(pdMS_TO_TICKS(100));