Create simple arduino library to use PCA9674PW I2C I/O expander
* method Init(Wire &I2cBus, bool AddressSwitch1, bool AddressSwitch2, bool AddressSwitch3);
we want to have I2C as reference. The i2c wire will be declared and initialised in main project and referenced only because we need to share I2C with another devices declared in main project.
* Method SetOutputs(bool Out1, bool Out2, bool Out3, bool Out4);
* Method void ReadIO(); Where the bits 0-3 Inputs and bits 4-7 are Outputs
And then lets have public union struct in library (byte Value and bools for Input 1-4 and ouptuts 1-4 (check [login to view URL] fiel example)
* Provide library with mentioned methods
* Library should include Arduino example code
You can simplify your work and you we have only header file.