21 lines
505 B
C
21 lines
505 B
C
|
|
#include "fan speeeed.h"
|
|
|
|
int fan_speed(float value){
|
|
float fan_speed;
|
|
float p = 0;
|
|
float timelate = 0;
|
|
float starttime = 0;
|
|
int oldPR = 0;
|
|
int curlPR;
|
|
int f;
|
|
if (curlPr > 300 && oldPr < 300){
|
|
starttime = millis();
|
|
p =(starttime - timelate);
|
|
timelate = startime;
|
|
}
|
|
oldPR = curlPR;
|
|
f = ((1/p)*1000);
|
|
fan_speed = (f*60)/2;
|
|
return fan_speed;
|
|
} |