move ct conversion counter

This commit is contained in:
Siwat Sirichai 2024-03-25 14:16:15 +07:00
parent 3a9488d4f8
commit 199a89a700
2 changed files with 2 additions and 1 deletions

View file

@ -30,7 +30,7 @@ void CurrentTransformerCard::loop()
if (this->lastConversionTime == 0) {
this->lastConversionTime = millis();
}
static uint32_t lastConversionLoopTime = 0;
if (millis() - lastConversionLoopTime > this->conversionInterval) {
this->beginConversion();
lastConversionLoopTime = millis();