sparkfun / SparkFun_HTU21D_Breakout_Arduino_Library

HTU21D Breakout Arduino Library
Other
31 stars 23 forks source link

Improve reliability and reduce code size #3

Closed baruch closed 8 years ago

baruch commented 8 years ago

This change refactors some code to reduce code size and allows even longer wait times for some devices that may need it at the same time as reducing the wait times for those that run faster.

nseidle commented 8 years ago

Good improvements. Thank you!

RaNo99 commented 8 years ago

There are three bugs in this commit:

  1. The comment at the beginning of read_value is inappropriate (should be generic but refers to humidity directly).
  2. The return type of read_value should be an unsigned integer, not float (saves a few bytes in flash).
  3. The 998 and 999 values are not respected by readHumidity and readTemperature. They will never be returned!
nseidle commented 7 years ago

Thanks RaNo99! Good points. Fixed in latest commit.