panStamp / thermistor

Arduino library for NTC thermistors
GNU Lesser General Public License v3.0
42 stars 20 forks source link

thermistor.read() return wrong value #10

Open sylim5442 opened 3 years ago

sylim5442 commented 3 years ago

I'm using 1.0.3 library Situation: when #include

Real Temp: 31.23 °C Using line: thermistor.read();

Expected behavior: return 31.23 Actual behavior : return 312

Problem -- thermistor.cpp

line 76 : int THERMISTOR::read(void) line 127 : return (int)(steinhart * 10);

-- thermistor.h

line 77 : int read(void);

My Fix -- thermistor.cpp

line 76 : float THERMISTOR::read(void) line 127 : return (float)(steinhart);

-- thermistor.h

line 77 : float read(void);