Skip to content
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

AM2320 #5

Open
nicolasdb opened this issue Sep 12, 2022 · 1 comment
Open

AM2320 #5

nicolasdb opened this issue Sep 12, 2022 · 1 comment

Comments

@nicolasdb
Copy link
Owner

https://github.com/adafruit/Adafruit_AM2320

I have a bad feeling that it will not work either because the same I2C problem as ADXL345 #4
Adafruit made this "Unified sensor" lib and it mess with ESP32C3 I2C. This is why I went back to use a simple DHT11 without I2C.

But let's try again.

@nicolasdb
Copy link
Owner Author

nicolasdb commented Sep 12, 2022

@ param the I2C Optional pointer to a TwoWire object that should be used for I2C communication. Defaults to &Wire.

So all you have to do is set the I2C SDA and I2C SCL variables to your selected SDA and SCL GPIOs.
However, if you’re using libraries to interface with those sensors, this may not work, and selecting alternative pins may be difficult. This arises because if you don’t pass your own Wire instance while initialising the library, those libraries may overwrite your pins.
In certain circumstances, we’ll need to look at the.CPP library files closely to figure out how to pass your own TwoWire arguments.

AM2320 work well whitout the need of TwoWire. Just add Wire.begin(SDA, SCL); in the setup.

But problem with Adafruit_AM2320
Humidity return "NaN" (Not a Number)

This one work well,
https://github.com/RobTillaart/AM232X

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant