Fix for incorrect RPM reported.
This commit is contained in:
parent
772c80aa85
commit
b5c15d97fa
@ -81,6 +81,7 @@ class PWMFanUsermod : public Usermod {
|
|||||||
detachInterrupt(digitalPinToInterrupt(tachoPin));
|
detachInterrupt(digitalPinToInterrupt(tachoPin));
|
||||||
// calculate rpm
|
// calculate rpm
|
||||||
last_rpm = counter_rpm * (60 / numberOfInterrupsInOneSingleRotation);
|
last_rpm = counter_rpm * (60 / numberOfInterrupsInOneSingleRotation);
|
||||||
|
last_rpm /= tachoUpdateSec;
|
||||||
// reset counter
|
// reset counter
|
||||||
counter_rpm = 0;
|
counter_rpm = 0;
|
||||||
// store milliseconds when tacho was measured the last time
|
// store milliseconds when tacho was measured the last time
|
||||||
|
Loading…
Reference in New Issue
Block a user