Comments (6)
Hi,
Thanks for your proposal, I will go through your points with my (first) thoughts.
Saves those raw values and exposes them
Given your rationale to transmit these - saving 50% - I think it is a good idea to do that. Names could be
- rawHumidity
- rawTemperature
I prefer accessor functions e.g. getRawHumidity() getRawTemperature() around to prevent writing to them.
These will be optimized by the compiler anyway but makes the variables effectively read-only preventing errors.
The extra storage is 4 bytes, which is no problem imho.
Moves the conversion to actual floating point values to the getTemperature() and getHumidity() functions?
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).
Optionally: create a pair of boolean flags _needToRecomputeTemp/_needToRecomputeHumidity.
Think this is fixing a problem "created by design changes above", yes I understand 100% why one could do this.
However it is far easier to tell the user that if he wants to speed things up, he should cache the value himself.
That would also keep the code and memory footprint smaller, so in short a note in the readme.md file should be sufficient.
Please update the version number to 0.3.2 in your PR.
Any questions, let me know / or discuss in PR
Rob
Note: https://github.com/RobTillaart/SHT85 will be updated later - I try to keep these "cousins" a bit in sync.
from sht31.
0.3.2 released,
from sht31.
@jgillula
FYI, added the changes to https://github.com/RobTillaart/SHT85 library
thanks
from sht31.
Thank you so much!
from sht31.
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
from sht31.
Thanks for the compliment, you helped to improve it.
If there are other issues or you need a "better" library for some other device let me know.
I do not have a sponsor program in place (yet) so please donate to a charity of your choice.
from sht31.
Related Issues (12)
- SHT31 library two I2C interfaces: example, advice needed HOT 31
- Add lastHeaterStopTime variable to prevent switching on the heater too early HOT 2
- Return 0.0C and 0.0% HOT 5
- isConnected returns true if voltaje to SHT31 is not connected. HOT 4
- SoftWire library + SHT31 library HOT 23
- prototype for 'bool SHT31::begin(uint8_t, uint8_t, uint8_t)' does not match any in class 'SHT31' HOT 6
- Using SHT31 in High Humidity Environment HOT 9
- check SHT2x functions added HOT 1
- Heater HOT 5
- SHT31 library with Arduino-ESP32 v2.0.5 HOT 8
- Question on i2c error handling HOT 23
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sht31.