Open Humancell opened 5 years ago
Just an update on my progress:
I completed the SoftwareWire integration. I've been testing and running it and it seems to be working.
I added the isPresent() method, and it also appears to be working.
I added the setI2CAddress() method and it also appears to be working.
I left all of the "#if ARDUINO >= 100" options ... it wasn't too hard to just leave it there. I have not tested with a version of the environment that old though.
I committed to my repo (https://github.com/Wovyn/Adafruit_ADS1X15) but haven't created a pull request yet ... I wanted to do more testing.
I'm open to any feedback or thoughts. I do know there are a few places the code is not as optimized as I'd like ... yet.
I wanted to touch base with you about some refactoring that I"m about to do, and also adding support for SoftwareWire functionality that I need.
Here are some of the changes that I intend to make, and I wanted your input and thoughts in case you might think about accepting a pull request back.
Adding SoftwareWire support: I need to use SoftwareWire to change the pins that I am using for I2C. I found a "nice" way that Sparkfun implemented this in their BME280 library, and I've now implemented it a few times. It adds a few new constructors that allow the Wire or SoftwareWire object to be passed in, along with the I2C address.
Adding a "isPresent()" method to test for the chip being present on the I2C bus at the current I2C address.
Adding a "setI2CAddress()" method to allow the I2C Address to be changed on the fly. Support for multiple chips.
Getting rid of the "#if ARDUINO >= 100" options as it seems that we are well past the time of needing this? It makes the support of hard and soft I2C select logic that much more complex. I could be convinced differently on this, and will see as I get going on the refactoring.
I'll be working on all of this today in the next few hours ... but wanted to get any feedback and ideas from you to make a future pull request cleaner.