Comments (6)
Unfortunately we don't support to change I2C address on runtime.
You can simply modify the driver and change the I2C address
from arduino-i2c-sht4x.
Maybe I explained the issue with too little details, so for now I will reformulate it as a question.
How could I communicate with a sensor of type SHT40-BD1B-R2 using this library? I can not set the i2c address anywhere and the default is not 0x44 but 0x45
from arduino-i2c-sht4x.
Hej @F-Schmidt99 ,
Not sure @psachs still has this old issue under the radar so I will jump in.
In the file https://github.com/Sensirion/arduino-i2c-sht4x/blob/master/src/SensirionI2CSht4x.cpp you can change the I2C address to 0x45 by setting SHT4X_I2C_ADDRESS
I hope it helps
Cheers
Edit: to be clear I am talking about directly editing the file. Which typically is easier when you cloned the repository and transferred the driver to your project (instead of installing it using the Arduino library manager)
from arduino-i2c-sht4x.
Hello @qfisch,
thank you for the response.
I know how to control the sensor by editing the file. But keeping in mind, that this library is for the Arduino framework, and therefor also used by many beginners, I think, that you should provide either a constructor or a 'begin' method taking the i2c address as uint8_t address argument. Alternatively, you could also pass an enum value like this:
enum SHTSensorType {
A = 0x44,
B = 0x45
};
for better readable code.
See here for guidelines of Arduino: https://docs.arduino.cc/learn/contributions/arduino-creating-library-guide
Kind regards.
from arduino-i2c-sht4x.
Hej @F-Schmidt99 ,
I just saw your PR as well. As explained there, the feature is planned and should be rolled out soon through our typical generation process. I will keep this issue open to make sure to notify you once it is available.
Cheers
Q
from arduino-i2c-sht4x.
Driver is now updated to included this feature
from arduino-i2c-sht4x.
Related Issues (3)
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 arduino-i2c-sht4x.