Skip to content

Commit 294254b

Browse files
author
jenkie
committed
Move thermistor to GND
1 parent 8312f30 commit 294254b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Arduino_Pedelec_Controller/Arduino_Pedelec_Controller.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,7 @@ if (loadcell.is_ready()) //new conversion result from load cell available
984984
#endif
985985

986986
#ifdef SUPPORT_THERMISTOR
987-
temperature_thermistor=1/(thermistor_t0+thermistor_b*log((10240/analogRead(thermistor_pin)-10)/thermistor_r))-273.15; //calculate thermistor temperature from Steinhart-Hart parameters
987+
temperature_thermistor=1/(thermistor_t0+thermistor_b*log((10/(1023.0/analogRead(thermistor_pin)-1))/thermistor_r))-273.15; //calculate thermistor temperature from Steinhart-Hart parameters
988988
#endif
989989

990990
battery_percent_fromcapacity = constrain((1-wh/ curr_capacity)*100,0,100); //battery percent calculation from battery capacity. For voltage-based calculation see above

0 commit comments

Comments
 (0)