mirror of
https://github.com/wled/WLED.git
synced 2025-07-22 18:26:32 +00:00
Fix for incorrect RPM reported.
This commit is contained in:
parent
62e7c861bd
commit
783a21d88d
@ -80,7 +80,8 @@ class PWMFanUsermod : public Usermod {
|
||||
// detach interrupt while calculating rpm
|
||||
detachInterrupt(digitalPinToInterrupt(tachoPin));
|
||||
// calculate rpm
|
||||
last_rpm = counter_rpm * (60 / numberOfInterrupsInOneSingleRotation);
|
||||
last_rpm = (counter_rpm * 60) / numberOfInterrupsInOneSingleRotation;
|
||||
last_rpm /= tachoUpdateSec;
|
||||
// reset counter
|
||||
counter_rpm = 0;
|
||||
// store milliseconds when tacho was measured the last time
|
||||
|
Loading…
x
Reference in New Issue
Block a user