write resistance calculation
This commit is contained in:
@@ -101,7 +101,11 @@ class PID {
|
||||
|
||||
int measureTemp() {
|
||||
//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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user