Fix names
This commit is contained in:
parent
849c719b59
commit
9f27bc8454
@ -30,8 +30,9 @@ float calculate_thermistor_temp(float readValue);
|
|||||||
|
|
||||||
|
|
||||||
// Returns true if temperatur is higher than max_temp
|
// Returns true if temperatur is higher than max_temp
|
||||||
bool error_message(float thermistor_temp, uint8_t max_temp);
|
bool voltage_threshold_bool(float thermistor_temp, uint8_t max_temp);
|
||||||
|
|
||||||
|
void voltage_threshold_exceeded(bool voltage_threshold_bool);
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
#include "themistor-temp.h"
|
#include "themistor-temp.h"
|
||||||
|
|
||||||
float calculate_thermistor_temp(float readValue){
|
float calculate_thermistor_temp(float thermistor_voltage){
|
||||||
float R_therm;
|
float R_therm;
|
||||||
float V_1;
|
float V_1;
|
||||||
float ln;
|
float ln;
|
||||||
@ -8,7 +8,7 @@ float calculate_thermistor_temp(float readValue){
|
|||||||
float V_therm;
|
float V_therm;
|
||||||
uint8_t V_tot = 5;
|
uint8_t V_tot = 5;
|
||||||
// Calculate Voltage over thermistor
|
// Calculate Voltage over thermistor
|
||||||
V_therm = (V_tot/1024)*readValue;
|
V_therm = (V_tot/1024)*thermistor_voltage;
|
||||||
|
|
||||||
// Voltage accross R_1
|
// Voltage accross R_1
|
||||||
V_1 = V_tot - V_therm;
|
V_1 = V_tot - V_therm;
|
||||||
@ -28,13 +28,19 @@ float calculate_thermistor_temp(float readValue){
|
|||||||
|
|
||||||
// returns error message if the messured thermistor temp is higher than
|
// returns error message if the messured thermistor temp is higher than
|
||||||
// Choosen max_temp
|
// Choosen max_temp
|
||||||
bool error_message(float thermistor_temp, uint8_t max_temp){
|
bool voltage_threshold_bool(float thermistor_temp, uint8_t max_temp){
|
||||||
// Return true if temp is higher then max value
|
// Return true if temp is higher then max value
|
||||||
if (thermistor_temp >= max_temp){
|
if (thermistor_temp >= max_temp){
|
||||||
printf("Error");
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//print if the maximum threshold is exceeded.
|
||||||
|
void voltage_threshold_exceeded(bool voltage_threshold_bool){
|
||||||
|
if (voltage_threshold_bool){
|
||||||
|
printf("Error: maximum temperature exceeded");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user