zerog2k / stc_diyclock

STC DIY Clock redux (STC15F204EA, STC15W404AS, STC15W408AS)
MIT License
170 stars 67 forks source link

Remove float calculations in main.c/gettemp() #21

Closed jjmz closed 7 years ago

jjmz commented 7 years ago

Hi, it's been a lot time I have not monitored the project.

Using float is generating more than 1K of code! This version of gettemp only uses 80 bytes to return Celcius or Farenheit depending on CONF_C_F.

Some approximations are needed, I created an .ods file to check if approximation gives a valid result.

zerog2k commented 7 years ago

thanks!