dbrgn / sht2x-rs Goto Github PK
View Code? Open in Web Editor NEWWIP Platform agnostic Rust driver for the Sensirion SHT2x temperature/humidity sensors.
License: Apache License 2.0
WIP Platform agnostic Rust driver for the Sensirion SHT2x temperature/humidity sensors.
License: Apache License 2.0
I think the minimum necessary for releasing to crates.io is probably to fix the temp type (#2) and add humidity measurement. I've got working code for that which returns an i32 for the RH value in thousands of a %RH (which I believe can go negative due to measurement errors, hence the i32).
I could also add an example based on the stm32f103 testrig which I'm using, which would probably be useful.
There are a few other possible features, such as reading the device serial number and implementing (optional) CRC checking which would probably be useful, as well as reset.
Also, a number of other devices have been created by other manufacturers which implement the same protocol as the Sensirion SHT2x, such as the Silicon Labs Si7021 & the TE (previously Measurement Specialties) HTU21D, so it would be useful if this at least showed up in crates.io searches (by adding it to the description) but alternatively the name could reflect this I suppose?
Hello,
I'd like to use this code (and carry on development of it - I have a number of SHT21 which I'd like to use in a couple of projects), but there's no license currently. According to https://choosealicense.com/no-permission/ if there's no license, then:
"Although a code host such as GitHub may allow you to view and fork the code, this does not imply that you are permitted to use, modify, or share the software for any purpose."
I wonder if you'd mind licensing it? The information at https://choosealicense.com/ might be useful.
FWIW, the rust embedded-hal is:
Licensed under either of
Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)at your option.
Thanks!
Tim.
👋🏽
Just wanted to say thanks for building this.
It works as advertised on a SHT20 sensor running on the ESP32c3-12F
The temperature method currently returns an i16 (which is documented as being milli-degrees Celsius), so will overflow at temperatures over 32.767°C, or below -32.768°C. The SHT21 operating range is -40°C to +125°C
Possible solutions would be to reduce the number of decimal places (e.g. to 2) or use an i32.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.