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 #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#include "uart.h"
#include <stdbool.h> #include <stdbool.h>
#include <float.h> #include <float.h>
#include <stdio.h> #include <stdio.h>

View File

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