Closed matthewlai closed 2 years ago
hiya! thanks so much for submitting a PR! we can review & merge PRs once they have passed continuous integration (CI). that means that code compiles cleanly for all tested platforms, is clang formatted so we maintain the same text formatting for all new code, and is doxygen documented. if your code isnt passing, check the CI output (click on the red X next to the PR to scroll through the log and find where the error is
here is a tutorial on doxygen: https://learn.adafruit.com/the-well-automated-arduino-library/doxygen
and clang-format: https://learn.adafruit.com/the-well-automated-arduino-library/formatting-with-clang-format
and overall how to contribute PRs to libraries: https://learn.adafruit.com/contribute-to-arduino-with-git-and-github
once you get that green checkmark that indicates CI has passed, please comment reply to this post so we know its time for another review (we may not get notified on CI pass and miss that its time to look!)
can you split the freq update and the refactor into 2 PRs? for freq update we have to be careful because other i2c devices may not be 400khz so maybe make the freq an argument or function :)
Done!
ok @caternuson is the expert on this libray and can review it next week most likely! thank yu :)
@matthewlai Thanks! This looks like a good refactor. Can you also add two new example sketches to demonstrate (1) continuous reading and (2) non-blocking reading. That'll help a lot to demonstrate using the new capabilities.
Done! They do compile for both ESP32 and AVR, but unfortunately I cannot test them as the only chip I have is now embedded in a wall :) My actual application uses the chip like in the continuous example though.
Thanks for the examples. Tested both using an Itsy M4 and they work as expected. One change for each, can use computeVolts
:
https://github.com/adafruit/Adafruit_ADS1X15/blob/da24495248886e9dfce5f5cec5359797fd586998/Adafruit_ADS1X15.h#L158
instead of using the hardcoded multiplier
. Something like:
Serial.print("Differential: "); Serial.print(results); Serial.print("("); Serial.print(ads.computeVolts(results)); Serial.println("mV)");
Done!
Awesome. Thanks!
A few changes:
All these changes are backward compatible.