Skip to content

Refactoring for SoftwareWire and other features ... #14

@Humancell

Description

@Humancell

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.

  1. 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.

  2. Adding a "isPresent()" method to test for the chip being present on the I2C bus at the current I2C address.

  3. Adding a "setI2CAddress()" method to allow the I2C Address to be changed on the fly. Support for multiple chips.

  4. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions