avsa242 / sht3x-spin Goto Github PK
View Code? Open in Web Editor NEWParallax P8X32A/Propeller, P2X8C4M64P/Propeller 2 driver object for the Sensirion SHT3x Temp/RH Sensor
License: MIT License
Parallax P8X32A/Propeller, P2X8C4M64P/Propeller 2 driver object for the Sensirion SHT3x Temp/RH Sensor
License: MIT License
When IntTempLoClear()
is called with an out-of-bounds value to query the current threshold, 0 is returned for most cases.
Implement methods to get/set tracking alerts for RH and Temp.
Once an alert is supposed to be triggered, verify the ALERT pin is asserted on the device and the relevant bits in the status register get set.
Implement methods to return raw Temp/RH sensor data from the device, for those that wish to do their own processing on the data. Right now, only a method that returns temperature in hundredths of a degree (e.g. 21.05 degrees C would be returned as 2105 centi-degrees C) and the equivalent for RH is implemented. This is due to fixed-point integer-only math.
For applications where data acquisition speed isn't as critical, but memory usage is, or an extra core can't be spared, support for the SPIN I2C engine should be added.
Setting the operating mode to continuous (opmode(CONT)
) has no effect. Nothing can be seen on the I2C bus when this method is called.
The temp interrupt threshold parameter is currently only accepted as Celsius. Read TempScale() to determine the correct scaling for the parameter given.
The interrupt thresholds aren't actually getting written - if a new threshold is written, and then read back from the chip, it returns the POR default value, $CD33.
Two issues:
The GetRH/Temp-related methods need to be cleaned up. Currently, there are four relevant methods:
GetTempRH(repeatability) - This is the one that actually retrieves the data from the sensor. The data are stored in two VAR words, one for temperature, one for RH.
GetTempC - This calculates and returns the temperature in hundredths of a degree Celsius for whatever the contents of the temperature word are.
GetRH - Works the same as GetTempC, for RH.
GetTempRH(ptr_word__temp, ptr_word__rh) - This calls GetTempC and GetRH and writes their return values at the address of the calling parameters.
Most of this mess was created by re-implementing things during development as things broke.
Proper handling of I2C transactions aren't handled (i.e., an unexpected NAK from the sensor), at least not consistently.
The periodic measurement mode (ContinuousRead, FetchData, Break) functions haven't been validated. In a very cursory initial test, they didn't seem to function properly, if at all.
Initially, code re-usability was actually better than it is now, but it was found to not work 100% of the time. This is mostly in reference to the lower-level I2C bits that happen in the driver. There were methods dedicated to reading bytes off the bus, rather than having separate instances in each calling method like now, but it turns out the way some registers are read from/written to isn't done exactly the same way as the others.
Some commands require an I2C stop (P) condition after the write header and command word are sent, while others expect the opposite. Some read transactions require delays added to parts of the transactions or they won't function properly. Others don't have this requirement.
Add code to demonstrate the sensor's interrupt capabilities.
Investigate a better way to implement repeatability mode. Maybe make the mode a global VAR state and have a discrete method to set it (SetRepeatabilityMode)?
Right now it's set on every call to GetTempRH
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.