write resistance calculation

This commit is contained in:
2026-09-21 18:20:26 +02:00
parent 0794536e6d
commit 0bd5fb3165
+5 -1
View File
@@ -101,7 +101,11 @@ class PID {
int measureTemp() { int measureTemp() {
//adc_select_input(thermistor_pin); //adc_select_input(thermistor_pin);
//uint16_t result = adc_read(); uint16_t result = adc_read();
uint16_t v_slash_vin = 2<<15 / result;
uint16_t r = v_slash_vin * voltage_devider_resistance / (1 / (1-v_slash_vin));
int T = 1/(1/thermistor_beta * log(r/thermistor_resistance) + 1/thermistor_ref_temp);
this->temp = 10; this->temp = 10;