I think there is a problem in I2CIO::read() function. T PCF8574 wont correctly work with input pin. According the datasheet, each input pin have to be kept HIGH at any write.
The function writes 0 to each input and it doesn' work. With the below fix it works as expected.
I'm using your lib for years so it is my two cents. Thank you!
Robert Badar (aka budvar10)
int I2CIO::write ( uint8_t value )
int status = 0;
if ( _initialised )
// Only write HIGH the values of the ports that have been initialised as
// outputs updating the output shadow of the device
// 15-FEB-2018 - fix, all I/Os initialized as input must be written as HIGH
// _shadow = ( value & ~(_dirMask) );
_shadow = ( value | _dirMask );
Wire.beginTransmission ( _i2cAddr );
if (ARDUINO < 100)
Wire.send ( _shadow );
Wire.write ( _shadow );
status = Wire.endTransmission ();
return ( (status == 0) );