JChristensen / DS3232RTC

Arduino Library for Maxim Integrated DS3232 and DS3231 Real-Time Clocks
GNU General Public License v3.0
392 stars 135 forks source link

Add function that returns temperature as Celsius as a float #52

Closed Doridian closed 6 years ago

Doridian commented 6 years ago

Returning temperature as C*4 might make sense data-wise and for internal processing, as that is the precision the chip works in, however it doesn't make sense for use as a display. And since the LSB is the decimal part and the MSB is the integral part, I think it makes sense adding that directly as a library function. Maybe also add a "temperatureFahrenheit" lateron?

JChristensen commented 6 years ago

That code will return incorrect values for temperatures < 0°C.