Fix libaries

This commit is contained in:
Inamr 2024-03-19 13:11:52 +01:00
parent d14044e8df
commit 9aa9c444c1
2 changed files with 12 additions and 13 deletions

View File

@ -13,7 +13,7 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "uart.h"
#include <stdbool.h>
#include <float.h>
#include <stdio.h>

View File

@ -1,21 +1,20 @@
#include "fan speeeed.h"
int fan_speed(float value){
int fan_speed(float voltage_value){
float fan_speed;
float p = 0;
float timelate = 0;
float starttime = 0;
int oldPR = 0;
int curlPR;
float t = 0;
float past_time = 0;
float start_time = 0;
int old_value = 0;
int f;
if (curlPr > 300 && oldPr < 300){
starttime = millis();
p =(starttime - timelate);
timelate = startime;
if (voltage_value > 300 && old_value < 300){
start_time = millis();
t =(start_time - past_time);
paste_time = start_time;
}
oldPR = curlPR;
f = ((1/p)*1000);
voltage_value = old_value;
f = ((1/t)*1000);
fan_speed = (f*60)/2;
return fan_speed;
}