HELP: PCF8575 Port Expander was PCF8574

Hi

If you look at the code in your three cases you will see there is little difference between them.
Combine them into one function, and just pass in the different values you want to use

I'am trying to learn as i go along with this project , could you give me some help with "function"
some sample code would be helpful
Thanks
Howard