speed_reader update test #6
This commit is contained in:
parent
a2c6a7a8cf
commit
a2ac636c27
1 changed files with 5 additions and 0 deletions
|
@ -39,6 +39,11 @@ def speed_calc():
|
||||||
time_delta = (now - last_time).total_seconds()
|
time_delta = (now - last_time).total_seconds()
|
||||||
|
|
||||||
actual_rpm = (impulses/pulses_per_rotation) * (60/time_delta)
|
actual_rpm = (impulses/pulses_per_rotation) * (60/time_delta)
|
||||||
|
|
||||||
|
last_rpm = float(get_variable("actual_rpm_unfiltered"))
|
||||||
|
actual_rpm = (last_rpm + actual_rpm) / 2
|
||||||
|
set_variable("actual_rpm_unfiltered", rpm, False)
|
||||||
|
|
||||||
set_variable("actual_rpm", round(actual_rpm, 1), False)
|
set_variable("actual_rpm", round(actual_rpm, 1), False)
|
||||||
print(actual_rpm)
|
print(actual_rpm)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue