TMP100 library - Please critique

All ESP8266 boards running MicroPython.
Official boards are the Adafruit Huzzah and Feather boards.
Target audience: MicroPython users with an ESP8266 board.
User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: TMP100 library - Please critique

Post by pythoncoder » Tue Jan 03, 2017 7:56 am

ernitron wrote:...as performance is concern I think the bitwise operation is faster...
Well, temperatures usually change slowly ;) Presumably your concern is the CPU time spent doing the read.

If so, bear in mind that floating point operations imply memory allocation. Also that multiplying by 0.0625 is the same as a sign-extended 4 bit right shift - albeit with the latter discarding fractional degrees. The best solution is application dependent; but for most practical purposes I'd probably stick with one of the floating point approaches.
Peter Hinch
Index to my micropython libraries.

Post Reply