-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exposing the raw temperature and humidity? #17
Comments
Hi, Thanks for your proposal, I will go through your points with my (first) thoughts.
Given your rationale to transmit these - saving 50% - I think it is a good idea to do that. Names could be
The rationale to have the math direct after read, is to do it only once per read. It allows one to access temperature / humidity more than once without redoing the math. So there is little need to change this sec. However in combination with the "raw" change it definitely makes sense (as the 2 floats to hold the temp/hum are replaced by 2 ints to hold their raw value).
Think this is fixing a problem "created by design changes above", yes I understand 100% why one could do this. Please update the version number to 0.3.2 in your PR. Any questions, let me know / or discuss in PR Note: https://github.com/RobTillaart/SHT85 will be updated later - I try to keep these "cousins" a bit in sync. |
0.3.2 released, |
@jgillula |
Thank you so much! |
BTW do you have a way I can toss some cash your way for making the most useful SHT-3X library I've found? :-D |
Thanks for the compliment, you helped to improve it. I do not have a sponsor program in place (yet) so please donate to a charity of your choice. |
Hi there! I'm using your awesome library for a low-power wireless temperature sensor I'm building.
To save power on my wireless node, I want to transmit the raw two-byte values for temperature and humidity instead of the four-byte floats. Would you be open to a PR that:
getTemperature()
andgetHumidity()
functions?_needToRecomputeTemp
/_needToRecomputeHumidity
that are set to True when the raw values are read inreadData(bool)
. Then, every timegetTemperature()
orgetHumidity()
check those flags and if they're true, then recompute the value based off the raw two-byte values, store it in the appropriate variable, and set the flag to false, so that ifgetTemperature()
orgetHumidity()
is called again, we skip redundant recomputation and just return the cached value.WDYT?
If this is all too complicated for you and you'd rather not accept a PR like this, no worries--I can always fork the library for my own purposes. I just thought since I was going to do the work anyway, I'd offer to share it back upstream.
The text was updated successfully, but these errors were encountered: