From 4a66e1dcdc9a34cba35a5ca03e1dca7c692148ee Mon Sep 17 00:00:00 2001 From: Inamr Date: Wed, 13 Mar 2024 13:16:16 +0100 Subject: [PATCH] add comments --- prosjekt.X/themistor-temp.h | 2 +- prosjekt.X/thermistor-temp.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/prosjekt.X/themistor-temp.h b/prosjekt.X/themistor-temp.h index 65c622c..e440f0c 100644 --- a/prosjekt.X/themistor-temp.h +++ b/prosjekt.X/themistor-temp.h @@ -27,7 +27,7 @@ extern "C" { // Calculates the temperature in celcius // Returns the thermistor themperature float calculate_thermistor_temp(float readValue); - +// Returns true if temperatur is higher then high_temp int bool error_message(float thermistor_temp); diff --git a/prosjekt.X/thermistor-temp.c b/prosjekt.X/thermistor-temp.c index 47442f5..afba6d5 100644 --- a/prosjekt.X/thermistor-temp.c +++ b/prosjekt.X/thermistor-temp.c @@ -26,9 +26,13 @@ float calculate_thermistor_temp(float readValue){ return T_therm; } +// returns error message bool error_message(float thermistor_temp){ + // Max value int high_temp = 0; + // Return true if temp is higher then max value if (thermistor_temp > high_temp){ + printf("Error"); return true; } else {